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
#!/bin/bash | |
i=0 | |
while read LINE | |
do | |
(youtube-dl $LINE -o "%(title)s.%(ext)s") & | |
let i++ | |
if (( $i % 3 == 0 )); then | |
wait # Limit to 3 concurrent subshells |
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
UNIMPLEMENTED=$(grep -nr 'yas-unimplemented' $1 | cut -d: -f 1 | uniq) | |
while read -r LINE; do | |
if [[ "$LINE" != *yas-setup.el* ]]; then | |
rm "$LINE" | |
fi | |
done <<< "$UNIMPLEMENTED" |
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
#!/bin/sh | |
if [ $# -lt 1 ]; then | |
echo "No destination defined. Usage: $0 destination" >&2 | |
exit 1 | |
elif [ $# -gt 1 ]; then | |
echo "Too many arguments. Usage: $0 destination" >&2 | |
exit 1 | |
fi |
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
casper = require('casper').create() | |
casper.start 'http://v2ex.com/signin' | |
casper.then -> | |
@fill 'form[action=\"/signin\"]', | |
'u': 'username' | |
'p': 'password' | |
, true |
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
find . -name '*.js' -not -path './node_modules/*' -exec sh -c 'js2coffee {} > {}.coffee && rm {}' \; |
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
var list = document.getElementById("list"); | |
for (var i = 1; i <= 5; i++) { | |
var item = document.createElement("LI"); | |
item.appendChild(document.createTextNode("Item " + i)); | |
item.onclick = function (ev) { | |
alert("Item " + i + " is clicked."); | |
}; | |
list.appendChild(item); |
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
require 'delegate' | |
class Bar < SimpleDelegator | |
def initialize(obj) | |
super(obj) | |
end | |
end | |
class Foo | |
end |
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
[Desktop Entry] | |
Name=Emacs Client | |
GenericName=Text Editor | |
Comment=Edit text | |
MimeType=x-scheme-handler/txmt;x-scheme-handler/emacs | |
Exec=/bin/emacsclient.rb %u | |
Icon=emacs | |
Type=Application | |
Terminal=false | |
Categories=Development;TextEditor; |
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
#!/bin/bash | |
# Remove Gnome launcher from Applications view | |
# ./rgl.sh qt4 avahi jdk | |
while read -r LINE; do | |
echo "NoDisplay=true" >> $LINE | |
done < <(pacman -Ql $@ | grep \.desktop$ | cut -d' ' -f2) |
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
var jq = document.createElement('script'); | |
jq.src = "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"; | |
document.getElementsByTagName('head')[0].appendChild(jq); | |
jQuery.noConflict(); | |
$('.WB_feed_type.SW_fun.type_intimate.S_line2').each(function(){ | |
$.post("https://api.weibo.com/2/statuses/destroy.json", | |
{ id: $(this).attr('mid'), | |
access_token: 'access_token' }); | |
}); |
OlderNewer