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 'securerandom' | |
| class ScreenCapture | |
| attr_reader :date_created, :file_name | |
| def initialize args | |
| @date_created = args[:time] | |
| @file_name = "#{args[:time].to_s.delete(' ')}#{args[:name]}.png" | |
| `screencapture -x #{@file_name}` |
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 'chronic' | |
| class RhythmClock | |
| def initialize wake, sleep | |
| @begin = wake | |
| @end = sleep | |
| end | |
| # returns integer in range (0, 100] | |
| def now(time=DateTime.now) |
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
| /* observed component */ | |
| typedef struct | |
| { | |
| int listener_count; | |
| /* array of function pointers */ | |
| void (*listener_list[10])(unsigned,unsigned); | |
| } Button; | |
| void button_Init( Button *pButton ) | |
| { |
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
| // what a beautiful application of synchronous channels! | |
| // source: https://blog.mozilla.org/services/2014/03/12/sane-concurrency-with-go/ | |
| type Account struct { | |
| balance float64 | |
| deltaChan chan float64 | |
| balanceChan chan float64 | |
| errChan chan error | |
| } |
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
| NAME(s) | |
| Brian Holder-Chow Lin On (brianhc) | |
| Nick Hewitt (nhewitt) | |
| DESIGN | |
| ====== | |
| Overview: | |
| We decided to use an explicit free list in the form of a hash table of linked | |
| lists. |
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
| A <- B <- C <- D <- E (master) | |
| A <- B <- C (master) | |
| A <- B <- C <- F <- G (feature) | |
| rebase: | |
| A <- B <- C <- D <- E <- F <- G (feature) |
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
| SELECT targets.id, targets.name, traits.id, traits.name | |
| FROM Traits INNER JOIN People AS targets ON | |
| targets.id != me | |
| LEFT OUTER JOIN Opinions AS ops ON | |
| ops.person_id = me AND | |
| ops.trait_id = traits.id AND | |
| ops.about_id = targets.id | |
| GROUP BY targets.id, traits.id | |
| HAVING(MAX(ops.update_at) | |
| WHERE ops.rating IS 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
| #homebrew before usr/bin | |
| export PATH=/usr/local/bin:$PATH | |
| # to load up z index | |
| . $HOME/bin/z.sh | |
| # appending to PATH | |
| PATH=$HOME/bin:$PATH | |
| # for virtualenvwrapper |
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
| ### Keybase proof | |
| I hereby claim: | |
| * I am perfmode on github. | |
| * I am btc (https://keybase.io/btc) on keybase. | |
| * I have a public key whose fingerprint is 0718 9EE5 4558 D12C 0F5E DAF9 4A80 1C5D 01C0 09DE | |
| To claim this, I am signing this object: |
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
| package blockservice | |
| import ( | |
| "bytes" | |
| "testing" | |
| "time" | |
| "github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/go.net/context" | |
| ds "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-datastore" | |
| dssync "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-datastore/sync" |