Skip to content

Instantly share code, notes, and snippets.

View ryanstout's full-sized avatar

Ryan Stout ryanstout

View GitHub Profile
var fsevents = require('fsevents');
var watcher = fsevents('/Users/ryanstout/Sites/infinitydrive/drive');
watcher.on('fsevent', function(path) { console.log(path); });
watcher.start();
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
require 'promise'
class PromiseRunner
attr_reader :promise
def initialize
@promise = Promise.new
end
def test
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
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]
{"volt/page/page"=>"{\"version\":3,\"file\":null,\"mappings\":\";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
class User < Volt::Model
validate do
if signed_up?
validate :password, password: true
end
end
end
func (fh *FileHandle) Write(req *fuse.WriteRequest, resp *fuse.WriteResponse, intr fs.Intr) fuse.Error {
// fmt.Printf("Write %s - %d at %d\n", fh.FuseFile.Path, len(req.Data), req.Offset)
fh.WrittenTo = true
size, err := fh.File.WriteAt(req.Data, req.Offset)
resp.Size = size
if err != nil {
fmt.Printf("Write Error: %s\n", err)
func (fh *FileHandle) Read(req *fuse.ReadRequest, resp *fuse.ReadResponse, intr fs.Intr) fuse.Error {
// fmt.Printf("Read %s - %d at %d\n", fh.FuseFile.Path, req.Size, req.Offset)
buf := make([]byte, req.Size)
// fmt.Printf("ReadAt: %d -- %d -- %d - %s\n", req.Offset, req.Size, len(resp.Data), fh.FuseFile.Path)
size, err := fh.File.ReadAt(buf, req.Offset)
if err != nil && err != io.EOF {
fmt.Printf("ERR FROM READ: %s\n", err)
# A sample Gemfile
source "https://rubygems.org"
gem 'rtanque', git: 'https://github.com/andrew/RTanque.git'
gem 'texplay', '0.4.4.pre'