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
<?php require_once("_setup.php"); ?> | |
<div class="container"> | |
<?php require_once("_header.php"); ?> | |
<div class="page"> | |
<div class="row"> | |
<div class="content col-md-8"> |
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
DB=foo | |
for table in `mysql -uroot $DB -e 'show tables' | grep -v '^Tables_in'`; do | |
echo dumping $table; | |
mysqldump5 -uroot -t --skip-opt --compact $DB $table > t-$table.sql; | |
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
# PASS FD TO ANOTHER PROCESS VIA UNIX SOCKET | |
def start_fd_listener | |
@pass_fd = UNIXServer.new("/tmp/puma_fd.sock") | |
ENV["PUMA_PASS_FD"] = @pass_fd.path | |
Thread.new { | |
begin | |
while true do | |
sock = @pass_fd.accept |
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
ruby-2.0.0-p247 $ pry | |
[1] pry(main)> "foo" "bar" | |
=> "foobar" | |
[2] pry(main)> a = "foo"; b = "bar"; | |
[3] pry(main)> a b | |
NoMethodError: undefined method `a' for main:Object | |
from (pry):3:in `__pry__' |
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
{ | |
"name": "Short name for this script", | |
// Hash of options accepted by this script, via stdin | |
// [OPTIONAL] | |
"options": { | |
"option_name" : { | |
"name" : "Sample option", | |
"desc" : "Description of option (defaults to '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
#!/usr/bin/env ruby | |
require 'fileutils' | |
require 'torrent-ruby' # gem install torrent-ruby | |
buff = [] | |
while true do | |
begin | |
buff << STDIN.read_nonblock(64000) | |
rescue |
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
[3] pry(main)> class String | |
[3] pry(main)* def call | |
[3] pry(main)* puts "hi" | |
[3] pry(main)* end | |
[3] pry(main)* end | |
=> nil | |
[4] pry(main)> "".call() | |
hi | |
=> nil | |
[5] pry(main)> "".() |
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
source "https://rubygems.org" | |
gem "multi_json" | |
gem "oj" | |
gem "json" | |
# Gems included by the bundle: | |
# * bundler (1.3.4) | |
# * json (1.8.0) | |
# * multi_json (1.7.6) |
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
#!/usr/bin/env ruby | |
require "daemons" | |
require "fileutils" | |
module Daemons | |
class Controller | |
def catch_exceptions(&block) | |
begin |
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
module BuildrClasspath | |
include Extension | |
first_time do | |
# Define task not specific to any projet. | |
desc 'Create classpath for passing to java command' | |
Project.local_task('classpath') | |
end |