This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xhr.onreadystatechange = function() { | |
if (xhr.readyState == 4) { // DONE | |
if (xhr.status == 200) { // OK | |
alert(xhr.responseText); | |
} else { | |
alert("status = " + xhr.status); | |
} | |
} | |
} | |
// GET |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh -t foo@bar /bin/zsh --login -c "screen" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
C:\cygwin\bin\mintty.exe -i "/Cygwin-Terminal.ico" -t Mintty /bin/zsh.exe --login -c "screen" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Google Drive URL: | |
https://drive.google.com/file/d/$foo | |
Open URL: | |
https://googledrive.com/host/$foo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[core] | |
excludesfile = ~/.gitignore_global | |
[alias] | |
# export to $1 which is supposed to be a dirname (it does the same as copying repo and removing .git) | |
aliases = !git config --get-regexp 'alias.*' | colrm 1 6 | sed 's/[ ]/ = /' | |
ammend = commit --amend | |
a = add -v | |
b = branch | |
br = branch | |
branches = branch -a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(global-set-key "\C-cw" 'cb-copy) | |
(global-set-key "\C-cy" 'cb-paste) | |
(defun cb-copy () | |
(interactive) | |
(let ((coding-system-for-write 'shift_jis-dos)) | |
(shell-command-on-region (region-beginning) (region-end) "cat > /dev/clipboard" nil nil nil)) | |
(message "")) | |
(defun cb-paste () | |
(interactive) | |
(let ((coding-system-for-read 'shift_jis-dos)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Retrieves all the rows in the active spreadsheet that contain data and logs the | |
* values for each row. | |
* For more information on using the Spreadsheet API, see | |
* https://developers.google.com/apps-script/service_spreadsheet | |
*/ | |
function deleteNewline() { | |
var sheet = SpreadsheetApp.getActiveSheet(); | |
var rows = sheet.getDataRange(); | |
var numRows = rows.getNumRows(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in `find . -name "*.html" | xargs grep -l "foo"` ; do | |
cp $i $i.org`date +%y%m%d` ; | |
sed 's/foo/bar/g' $i.org`date +%y%m%d` > $i ; | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in {1..100}; | |
do; | |
case $(($i%3)) in; | |
0)echo Fizz; | |
case $(($i%5)) in; | |
0)echo Buzz;; | |
esac;; | |
*)echo $i;; | |
esac; | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function rename () { | |
for i in *$1* ; do | |
\mv $i `echo $i | sed -e s,$1,$2,g` | |
done | |
} | |
alias rn="rename" | |
# recusively | |
function rename-recursively () { | |
find . | while read file ; do |