Skip to content

Instantly share code, notes, and snippets.

@rbres
rbres / bitstamp_auth.rb
Last active November 23, 2018 11:08
Ruby Bitstamp API Authentication and Post
def authenticate
nonce = (1000*Time.now.to_f).to_i.to_s
message = nonce + YOUR_CLIENT_ID + YOUR_API_KEY
hmacsha256 = OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha256'), YOUR_SECRET, message)
# sig = hmacsha256.each_byte.map { |b| b.to_s(16) }.join
sig = hmacsha256.unpack('H*').first
signature = sig.upcase
# example http post - balance function
uri = URI.parse("https://www.bitstamp.net/api/balance/")
@rbres
rbres / linked_connections.js
Last active September 17, 2015 07:13
Reveal Actual Linkedin Connections
if(document.URL.indexOf("linkedin.com") > -1){
var all_dds = document.getElementsByTagName("dd");
var table_item = all_dds.item(2);
var url = "https://www.linkedin.com" + table_item.firstChild.getAttribute("href");
$.ajax(url,{
headers: {
"Upgrade-Insecure-Requests": 1
},
xhr: function() {
var xhr = jQuery.ajaxSettings.xhr();
@rbres
rbres / gist:7938348
Last active March 4, 2016 04:47
Set Custom Youtube Playback Speed (ex. 3X)
vid = document.getElementsByClassName("video-stream html5-main-video")[0];
vid.playbackRate = 3.0;