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
| mysql> select * from items; | |
| +------+----+ | |
| | name | id | | |
| +------+----+ | |
| | aaa | 1 | | |
| | bbb | 2 | | |
| | ccc | 3 | | |
| | ddd | 4 | | |
| +------+----+ | |
| 4 rows in set (0.00 sec) |
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
| # clone a github project | |
| function clone { | |
| # check arguments | |
| acc=${1%%/*} | |
| prj=${1##*/} | |
| if [ -z "$acc" -o -z "$prj" ] ; then | |
| echo 'usage: clone <github_account>/<project>' | |
| return 1 | |
| fi |
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
| require 'ruby-debug' | |
| require 'socket' | |
| require 'forwardable' | |
| class SporkDebugger | |
| DEFAULT_PORT = 10_123 | |
| HOST = '127.0.0.1' | |
| extend Forwardable | |
| def_delegators :state, *[:prepare_debugger, :initialize] |
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
| diff --git a/lib/guard/spork/fake_spawn.rb b/lib/guard/spork/fake_spawn.rb | |
| new file mode 100644 | |
| index 0000000..8551778 | |
| --- /dev/null | |
| +++ b/lib/guard/spork/fake_spawn.rb | |
| @@ -0,0 +1,7 @@ | |
| +module FakeSpawn | |
| + if RUBY_VERSION < '1.9' | |
| + def spawn(cmd) | |
| + system(cmd + ' >/dev/null 2>&1 < /dev/null &') |
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
| .ui-btn-up-f, .ui-btn-hover-f, .ui-btn-down-f { | |
| color: white; | |
| font-weight: bold; | |
| text-decoration: none; } | |
| .ui-btn-up-f { | |
| border: 1px solid #711414; | |
| background: #ab2525; | |
| text-shadow: 0 -1px 1px #711414; | |
| background-image: -moz-linear-gradient(top, #c44f4f, #ab2525); |
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
| function webrick { | |
| if [ -z "$1" ] ; then | |
| port=3333 | |
| else | |
| port=$1 | |
| fi | |
| ruby -rwebrick -e "WEBrick::HTTPServer.new(:DocumentRoot => './', :Port => ${port}).tap{|w| Signal.trap(:INT){w.shutdown()} }.start" | |
| } |
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
| require 'sinatra' | |
| configure do | |
| set :port, 9999 | |
| end | |
| allow_all = { | |
| 'Access-Control-Allow-Headers' => 'X-Requested-With, X-File-Name, Content-Type', | |
| 'Access-Control-Allow-Origin' => '*', | |
| } |
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
| class Singleton | |
| # We can make private variables! | |
| instance = null | |
| # Static singleton retriever/loader | |
| @get: -> | |
| unless instance | |
| instance = new @ | |
| instance.init() | |
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
| require 'base64' | |
| require 'cairo' | |
| require 'stringio' | |
| png_b64 = <<END | |
| iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAC7mlDQ1BJQ0Mg | |
| UHJvZmlsZQAAeAGFVM9rE0EU/jZuqdAiCFprDrJ4kCJJWatoRdQ2/RFiawzb | |
| H7ZFkGQzSdZuNuvuJrWliOTi0SreRe2hB/+AHnrwZC9KhVpFKN6rKGKhFy3x | |
| zW5MtqXqwM5+8943731vdt8ADXLSNPWABOQNx1KiEWlsfEJq/IgAjqIJQTQl | |
| VdvsTiQGQYNz+Xvn2HoPgVtWw3v7d7J3rZrStpoHhP1A4Eea2Sqw7xdxClkS |
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 = window.app | |
| class app.Singleton | |
| instance = null | |
| @get: -> | |
| unless instance | |
| instance = new this | |
| instance.init() | |
| instance |
OlderNewer