Commit all deleted files in git

I had like 100+ files deleted from upgrading to a newer version of wordpress. Below is how to batch commit those deleted files in git. git add -u That will stage all those deleted files (that have been tracked before). Ref: http://stackoverflow.com/questions/1402776/how-do-i-commit-all-deleted-files-in-git

May 4, 2014 · 1 min · birdchan

vis.js

Here is a fun graphing library to play with! =) Vis.js is a dynamic, browser based visualization library. The library is designed to be easy to use, to handle large amounts of dynamic data, and to enable manipulation of and interaction with the data. The library consists of the components DataSet, Timeline, and Graph. #mygraph { width: 400px; height: 400px; border: 1px solid lightgray; } /js/vis.js // create an array with nodes var nodes = [ {id: 1, label: ‘Node 1’}, {id: 2, label: ‘Node 2’}, {id: 3, label: ‘Node 3’}, {id: 4, label: ‘Node 4’}, {id: 5, label: ‘Node 5’} ]; // create an array with edges var edges = [ {from: 1, to: 2}, {from: 1, to: 3}, {from: 2, to: 4}, {from: 2, to: 5} ]; // create a graph var container = document.getElementById(‘mygraph’); var data = { nodes: nodes, edges: edges }; var options = {}; var graph = new vis.Graph(container, data, options); ...

May 4, 2014 · 2 min · birdchan

Planning a responsive web interface

Here is a nice read! When planning a responsive web interface, here are 11 things to avoid. http://geeks.bizzabo.com/post/84426347039/11-things-to-avoid-when-planning-a-responsive-web

May 2, 2014 · 1 min · birdchan

A CSS button library

Here is one nice CSS button library. http://alexwolfe.github.io/Buttons/

May 2, 2014 · 1 min · birdchan

Undo last git commit

To undo a git commit locally, do the following. git log git revert __my_commit_id__ The following will also work. –hard would physically remove your commit, while –soft would simply jump back one commit. git reset --hard HEAD~1 git reset --soft HEAD~1 ref: http://stackoverflow.com/questions/927358/how-to-undo-the-last-git-commit

April 28, 2014 · 1 min · birdchan

To vertically and horizontally center text in a div

Use the following to vertically and horizontally center text in a div using display: flex. Hello World! This is line 2… div#my_flex_example{ height: 150px; background: #ccc; display: flex; justify-content: center; align-items: center; border-radius: 15px; } div{ height: 150px; background: #ccc; display: flex; justify-content: center; align-items: center; } For maximum compatibility, add the following: display: -webkit-box; display: -moz-box; display: -ms-flexbox; display: -webkit-flex; display: flex; ref: http://stackoverflow.com/questions/16280040/css3-flexbox-display-box-vs-flexbox-vs-flex

April 27, 2014 · 1 min · birdchan

Install HHVM

Here are the instructions to install HHVM on Ubuntu 12.04. sudo add-apt-repository ppa:mapnik/boost wget -O - http://dl.hhvm.com/conf/hhvm.gpg.key | sudo apt-key add - echo deb http://dl.hhvm.com/ubuntu precise main | sudo tee /etc/apt/sources.list.d/hhvm.list sudo apt-get update sudo apt-get install hhvm To test if your HHVM is installed, save the following into a file called test.php. Notice there is NO closing tag for hh. <?hh print "hellon"; Then run hhvm test.php, you should see the hello string gets printed out. ...

April 27, 2014 · 1 min · birdchan

Wordpress admin css js error

My wordpress admin page was looking weird for a while. I opened up the debug console and found out some of the css and js files didn’t load correctly. After doing some searches, I found the following fix from here. Simply, in wp-config.php before the require_once lines add the following define('CONCATENATE_SCRIPTS', false); After that, your admin page will look all clean and normal! =)

April 27, 2014 · 1 min · birdchan

Find a file by filename

If you wanna find a file by filename on osx, you can simply use spotlight to locate and open it. However sometimes you want to also know the folder or path of such file. I am not sure how to do that in spotlight or preview but the following command will help. find ~ -iname "my_file.png" The command above will look for my_file.png in your home directory (i.e. ~) and print out the full path of it. ...

April 27, 2014 · 1 min · birdchan

Unsung Hero

[youtube &w=640&h=360] http://thaigoodstories.com/

April 19, 2014 · 1 min · birdchan