How to unfreeze after accidentally pressing Ctrl-S in a terminal?

This happens a lot for me… out of habit to save a doc. But when a terminal freezes, Esc won’t work and I often just close the terminal… not a good idea especially when there are open file handlers… To unfreeze it, simply do Ctrl-Q. Yea, seriously, you won’t quit your terminal. Try it! =) ref: http://unix.stackexchange.com/questions/12107/how-to-unfreeze-after-accidentally-pressing-ctrl-s-in-a-terminal

May 22, 2014 · 1 min · birdchan

Finding substring in google spreadsheet

Here is how to find substrings in google spreadsheet. Say you have a long string in cell AJ13 and want to see if the substring Obama in China is in there. This is how you do it. =IF( ISNUMBER( FIND( "Obama in China" ; AJ13 ) ) ; "YES" ; "NOT SURE" ) You can nest it for more interesting result. (But not too long…) =IF( ISNUMBER( FIND( "Obama in China" ; AJ13 ) ) ; "China" ; IF( ISNUMBER( FIND( "Obama in India" ; AJ13 ) ) ; "India" ; IF( ISNUMBER( FIND( "Obama in Europe" ; AJ13 ) ) ; "Europe" ; IF( ISNUMBER( FIND( "Obama in Africa" ; AJ13 ) ) ; "Africa" ; "NOT SURE" ) ) ) ) That is 4-level deep, basically to start a new if-statement at the else section. =IF( ISNUMBER( FIND( “Obama in China” ; AJ13 ) ) ; “China” ; IF( ISNUMBER( FIND( “Obama in India” ; AJ13 ) ) ; “India” ; IF( ISNUMBER( FIND( “Obama in Europe” ; AJ13 ) ) ; “Europe” ; IF( ISNUMBER( FIND( “Obama in Africa” ; AJ13 ) ) ; “Africa” ; “NOT SURE” ) ) ) ) ...

May 21, 2014 · 1 min · birdchan

Text to Columns in Google Spreadsheet

To enable Text to Columns in Google Spreadsheet, copy-n-paste the following script. Here are the steps: Open a spreadsheet Tools -> Script Editor… In Code.gs, copy-n-paste the following code to replace the empty myFunction(). File -> Save. Then give a name to this script workspace. (You won’t see it again) Then close the script editor, go back to your spreadsheet. Refresh your spreadsheet. You will see the additional Advanced menu item there. ...

May 21, 2014 · 3 min · birdchan

Download youtube videos

Here is a nice tool to download youtube videos. It’s called youtube-dl. You can install it as follows. sudo curl https://yt-dl.org/downloads/2014.05.05/youtube-dl -o /usr/local/bin/youtube-dl sudo chmod a+x /usr/local/bin/youtube-dl Or if you have apt-get, simply do sudo apt-get install youtube-dl. Here is the documentation on how to use it. Below is a simple command to get you started. =) # using the video title as filename youtube-dl -o "%(title)s.%(ext)s" "https://www.youtube.com/watch?v=R9ohnM69JQ0" --restrict-filenames The –restrict-filenames flag will take away the special characters in output filename. ...

May 6, 2014 · 1 min · birdchan

Look Up

[youtube &w=640&h=360]

May 6, 2014 · 1 min · birdchan

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