Skip to content

Instantly share code, notes, and snippets.

View ryanstout's full-sized avatar

Ryan Stout ryanstout

View GitHub Profile
{"volt/page/page"=>"{\"version\":3,\"file\":null,\"mappings\":\";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
compiled, running...
Starting 443...
Mount /Users/ryanstout/Sites/infinitydrive/go/drive at /Users/ryanstout/Sites/infinitydrive/go/drivemount
2014/11/03 14:19:44 FUSE: <- Init [ID=0x0 Node=0x0 Uid=0 Gid=0 Pid=65567] 7.8 ra=16777216 fl=0
2014/11/03 14:19:44 FUSE: -> ID=0x0 Init {MaxReadahead:0 Flags:InitBigWrites MaxWrite:131072}
2014/11/03 14:19:44 FUSE: <- Statfs [ID=0x0 Node=0x1 Uid=0 Gid=0 Pid=65567]
2014/11/03 14:19:44 FUSE: -> ID=0x0 Statfs {Blocks:121837600 Bfree:17768033 Bavail:17704033 Files:121837598 Ffree:21359161 Bsize:4096 Namelen:2048 Frsize:0}
2014/11/03 14:19:44 FUSE: <- Statfs [ID=0x0 Node=0x1 Uid=0 Gid=0 Pid=65567]
2014/11/03 14:05:21 FUSE: <- Access [ID=0x8 Node=0x1 Uid=220 Gid=220 Pid=62095] mask=0x0
2014/11/03 14:05:21 FUSE: -> ID=0x8
2014/11/03 14:05:25 FUSE: <- Access [ID=0x9 Node=0x1 Uid=501 Gid=20 Pid=336] mask=0x0
2014/11/03 14:05:25 FUSE: -> ID=0x9
2014/11/03 14:05:25 FUSE: <- Getattr [ID=0xa Node=0x1 Uid=501 Gid=20 Pid=336]
2014/11/03 14:05:25 FUSE: -> ID=0xa Getattr {AttrValid:1s Attr:{Inode:7814970 Size:136 Blocks:0 Atime:2014-11-03 14:05:18 -0700 MST Mtime:2014-11-03 14:05:17 -0700 MST Ctime:2014-11-03 14:05:17 -0700 MST Crtime:2014-11-03 14:05:17 -0700 MST Mode:drwxrwxrwx Nlink:4 Uid:501 Gid:20 Rdev:0 Flags:0}}
2014/11/03 14:05:25 FUSE: <- Statfs [ID=0x7 Node=0x1 Uid=501 Gid=20 Pid=336]
2014/11/03 14:05:25 FUSE: -> ID=0x7 Statfs {Blocks:121837600 Bfree:17771751 Bavail:17707751 Files:121837598 Ffree:21362879 Bsize:4096 Namelen:2048 Frsize:0}
2014/11/03 14:05:25 FUSE: <- Access [ID=0x0 Node=0x1 Uid=501 Gid=20 Pid=336] mask=0x0
require 'promise'
class PromiseRunner
attr_reader :promise
def initialize
@promise = Promise.new
end
def test
module Logger
module ClassMethods
def __log(method_name)
orig_method_name = :"orig_#{method_name}"
alias_method orig_method_name, method_name.to_sym
define_method(method_name) do |*args, &block|
begin
puts "Before: #{args.inspect}"
5 / 0
var fsevents = require('fsevents');
var watcher = fsevents('/Users/ryanstout/Sites/infinitydrive/drive');
watcher.on('fsevent', function(path) { console.log(path); });
watcher.start();
@ryanstout
ryanstout / opal.js
Created November 20, 2013 23:36
Opal generated code
(function(undefined) {
// The Opal object that is exposed globally
var Opal = this.Opal = {};
// The actual class for BasicObject
var RubyBasicObject;
// The actual Object class
var RubyObject;
@ryanstout
ryanstout / gist:5959461
Created July 9, 2013 17:40
Lets you do: a = 5 ; b = 10 ; c = 30 ; 'a, b, c'.h # => {a: 5, b: 10, c: 30}
require 'binding_of_caller'
class String
def h
args = self.split(/,/).map {|a| a.strip }
arg_vals = args.map {|a| [a, binding.of_caller(2).eval(a)] }
return Hash[arg_vals]
end
<!-- CrowdTranslator JS -->
<script type="text/javascript">
(function() {
var ct = document.createElement('script'); ct.type = 'text/javascript'; ct.async = true;
ct.src = ('https:' == document.location.protocol ? 'https://d20z6ezet11y6s.cloudfront.net' : 'http://jscdn.crowdtranslator.com') + '/javascripts/page_translator.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ct, s);
})();
</script>
<!-- End CrowdTranslator JS -->
# How to run a generator from a plugin's install.rb
begin
# First have to load up rails
unless Kernel.const_defined?('RAILS_ROOT')
Kernel.const_set('RAILS_ROOT', File.join(File.dirname(__FILE__), '..', '..', '..'))
end
if (File.exists?(RAILS_ROOT) && File.exists?(File.join(RAILS_ROOT, 'app')))
require "#{RAILS_ROOT}/config/boot"