Skip to content

Instantly share code, notes, and snippets.

View leishman's full-sized avatar

Alexander Leishman leishman

  • River Financial
  • San Francisco, CA
  • X @leishman
View GitHub Profile
@leishman
leishman / 0.2.1-boggle_class_from_methods.rb
Last active December 27, 2015 17:49 — forked from dbc-challenges/0.2.1-boggle_class_from_methods.rb
phase 0 unit 2 week 1 boggle class challenge
## NOTE: THERE IS AN ERROR AND THE SAME GIST IS BEING USED FOR BOGGLE AND PEZ. NOT SURE WHY. HERE IS MY PEZ CLASS:
class Pez
def initialize(pez)
@pez = pez
end
def get_pez
@pez.pop
@leishman
leishman / jquery_example.html
Created December 26, 2013 17:04 — forked from dbc-challenges/jquery_example.html
Intro to jQuery for Phase 0
<!DOCTYPE html>
<html>
<head>
<title>DOM manipulation with jQuery</title>
<!-- Add a link to jQuery CDN here script here -->
<script type="text/javascript" src="jquery_example.js"></script>
</head>
<body>
# Arrays
# Array#reverse_each
# Just like Array#each, but reversed.
# This saves having to reverse an array if trying to iterate from the end
a = [1, 2, 3, 4]
str = ""
a.reverse_each{ |n| str += n.to_s } # str => "4321"
# require 'pry'
# You should re-use and modify your old BoggleBoard class
# to support the new requirements
class Cell
attr_accessor :letter, :index, :row, :column, :neighbors, :neighbor_letters, :used
def initialize(letter, index)
@letter = letter
@index = index
Balance {"current_user"=>{"id"=>"5281ce07ab5a5c4ace00003d", "email"=>"[email protected]", "name"=>"[email protected]"}, "balance"=>{"amount"=>"0.00150165", "currency"=>"BTC"}, "transactions"=>[{"transaction"=>{"id"=>"52e979e255d8f26ad40000ba", "created_at"=>"2014-01-29T14:00:02-08:00", "hsh"=>nil, "amount"=>{"amount"=>"0.00130641", "currency"=>"BTC"}, "request"=>false, "status"=>"complete", "sender"=>{"id"=>"51c3b06779a2cc9bb3000021", "email"=>"[email protected]", "name"=>"Alexander"}, "recipient"=>{"id"=>"", "email"=>"", "name"=>"New User"}, "recipient_address"=>"1DdUcZco2BV7xT1Rxcgp4oZ8Yp71EVKddh", "notes"=>"Voluptatem dicta quis non omnis est.", "idem"=>""}}, {"transaction"=>{"id"=>"52e979686f397ea9e700016e", "created_at"=>"2014-01-29T13:58:00-08:00", "hsh"=>nil, "amount"=>{"amount"=>"-0.00377100", "currency"=>"BTC"}, "request"=>false, "status"=>"complete", "sender"=>{"id"=>"5281ce07ab5a5c4ace00003d", "email"=>"[email protected]", "name"=>"[email protected]"}, "recipient"=>{"id"=>"51c3b06
API-Key = API key
API-Sign = Message signature using HMAC-SHA512 of (URI path + SHA256(nonce + POST data)) and base64 decoded secret API key
require 'httparty'
require 'hashie'
require 'Base64'
require 'addressable/uri'
def post_private(method, opts={}) # Example: post_private('Balance') #=> returns balance info from Kraken, opts not necessary
opts['nonce'] = nonce
post_data = encode_options(opts)
headers = {
@leishman
leishman / pinger.css
Last active August 29, 2015 14:05
CSS for a sonar-like pinger
/* Create as many divs as you would like in your pinger */
/*Give each of them this class*/
.propagating-circle {
position: absolute;
top: 200px;
left: 200px;
border-radius: 50%;
border: 1px solid black;
}
@leishman
leishman / pinger.html
Last active August 29, 2015 14:05
HTML for a sonar-like pinger
<div class="propagating-circle ping"></div>
<div class="propagating-circle ping delay-p5s"></div>
<div class="propagating-circle ping delay-1s"></div>
<div class="propagating-circle ping delay-1p5s"></div>
<div class="propagating-circle ping delay-2s"></div>

Keybase proof

I hereby claim:

  • I am leishman on github.
  • I am leishman (https://keybase.io/leishman) on keybase.
  • I have a public key whose fingerprint is D7B0 60F4 DE39 077C F7BB 6D90 9B83 C27E C257 736E

To claim this, I am signing this object: