This file contains hidden or 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
| #! /usr/bin/env ruby | |
| ['rubygems', 'spider', 'hpricot', 'iconv'].each {|f| require f } | |
| class Converter | |
| def initialize(encoding_to="utf8") | |
| @to = encoding_to | |
| end | |
| def convert(str, encoding_from) | |
| i = Iconv.new(@to, encoding_from) | |
| c_str = "" | |
| begin |
This file contains hidden or 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
| app.js |
This file contains hidden or 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 -e | |
| # | |
| # This script checks if useful versions of node.js and npm are installed | |
| # on the system, and if not it attempts to install them. | |
| # | |
| # Should work on Debian based systems and OS X. | |
| # So far tested on Kubuntu 12.04. | |
| # | |
| _die(){ |
This file contains hidden or 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
| Whatever. |
This file contains hidden or 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
| # Exploratory variant of: http://www.quora.com/Web-Development/What-are-the-most-interesting-HTML-JS-DOM-CSS-hacks-that-most-web-developers-dont-know-about/answer/Mohnish-Thallavajhula?__snids__=92752551&__nsrc__=1 | |
| # Enter the following URI in a browser and/or save it as a bookmarklet: | |
| data:text/html,<body contenteditable id=$><p>w<b>rite</b><i> rich</i> text..</p><button style="top:0;right:0;position:fixed"onclick=alert($.innerHTML.slice(0,-112))>Get HTML Markup | |
| # Congratulations, you now have a *very* hackish rich text format editor with a button to get the text as HTML, anytime you click the bookmarklet. |
This file contains hidden or 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 | |
| # A variant of watch, with smarter color support etc. | |
| [[ $SLEEP ]] || SLEEP=2 | |
| cmd=$* | |
| prev_output="" | |
| while true ; do | |
| output="$( $cmd 3>&1 2>&3 )" |
This file contains hidden or 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 f in `find . -name '*.js'`; do js2coffee $f > ${f%%js}coffee && rm $f; done |
This file contains hidden or 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
| <script> | |
| (function(){ | |
| console.log('%c very console', | |
| 'color: blue; font-size: 24px; font-family: "Comic Sans MS"'); | |
| console.log('%c such script', | |
| 'color: green; font-size: 18px; font-family: "Comic Sans MS"'); | |
| Object.defineProperty(console, '_commandLineAPI', { |
This file contains hidden or 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 | |
| # Install "ni" prefix for executing scripts without allowing internet access. | |
| # Tested on Ubuntu 13.04. | |
| # Example: | |
| # $ ni ping google.com | |
| # ping: unknown host google.com | |
| # | |
| # $ ping google.com | |
| # PING google.com (173.194.40.229) 56(84) bytes of data. | |
| # 64 bytes from arn02s06-in-f5.1e100.net (173.194.40.229): icmp_req=1 ttl=59 time=1.41 ms |
This file contains hidden or 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
| 1. Open http://translate.google.com/#ja/en/gh%20bchtk%20pv%20zk%20pv%20pv%20zk%20pv%20zk%20kz%20kh%20pv%20zk%20pv%20zk%20bchkt%20zk%20pzk%20pzk%20kkkkkk%20bsch%0Abchtk%20zk%20kppp%20bsch%20sss%20gh. | |
| 2. Press the left speaker button to listen. | |
| 3. Record output with: | |
| parec --format=s16le --device=alsa_output.pci-0000_00_1b.0.analog-stereo.monitor | oggenc --raw --quiet -o dump.ogg - |
OlderNewer