start new:
tmux
start new with session name:
tmux new -s myname
| #include <stdlib.h> | |
| #include <stdio.h> | |
| #include <ruby.h> | |
| #include <node.h> | |
| #include <oboe/oboe.h> | |
| oboe_reporter_t udp_reporter; | |
| #ifdef RUBY_GC_EVENT_ALL | |
| // requires https://github.com/tmm1/brew2deb/blob/master/packages/ruby/patches/gc-hooks.patch |
| // | |
| // Example usage: phantomjs screenshot.js http://yahoo.com /tmp/yahoo.png | |
| // | |
| var system = require('system'); | |
| var url = system.args[1]; | |
| var filename = system.args[2]; | |
| var page = new WebPage(); | |
| page.open(url, function (status) { |
| .border-container { | |
| width: 28%; /* border will be on the left on this container */ | |
| float: right; | |
| overflow: hidden; /* only needed if floating container */ | |
| min-height: 600px; /* static height if you want your container to be taller than its content */ | |
| -moz-box-shadow: inset 15px 0 5px -16px rgba(0,0,0,.1), -1px 0 0 #FFF; | |
| -webkit-box-shadow: inset 15px 0 5px -16px rgba(0,0,0,.1), -1px 0 0 #FFF; | |
| box-shadow: inset 15px 0 5px -16px rgba(0,0,0,.1), -1px 0 0 #FFF; | |
| border-width: 0 0 0 1px; | |
| -webkit-border-image: |
| # When a proxy request comes in, send it to Rails for authorization: | |
| location /api/proxy { | |
| proxy_pass http://rails; | |
| } | |
| # Rails will send an X-Accel-Redirect if the proxy request is valid, | |
| # attaching any domain information the proxy needs so it doesn't have | |
| # to do database lookups: | |
| location /proxy { | |
| internal; |
| # A chainable Either monad for Ruby | |
| # | |
| # Examples | |
| # | |
| # Either.right('s') >> proc { |s| Either.right(s + '-1') } >> proc { |s| Either.right(s + '-2') } | |
| # #=> #<Either @left=nil, @right="s-1-2"> | |
| # | |
| # Either.right('s') >> proc { |s| Either.left('error!') } >> proc { |s| Either.right(s + '-2') } | |
| # #=> #<Either @left='error!', @right=nil> | |
| # |
cribbed from http://pastebin.com/xgzeAmBn
Templates to remind you of the options and formatting for the different types of objects you might want to document using YARD.
| require 'webrick' | |
| class Server < WEBrick::HTTPServlet::AbstractServlet | |
| def self.start(port,host=nil) | |
| server = WEBrick::HTTPServer.new(:Host => host, :Port => port) | |
| server.mount '/', self | |
| trap('INT') { server.shutdown } |