Skip to content

Instantly share code, notes, and snippets.

View seanrose's full-sized avatar

sean rose seanrose

View GitHub Profile
curl YOUR_WEBHOOK_URL -d '{"attachments": [{"text": "bernese\nmountain\ndog"}]}'
@seanrose
seanrose / gist:baddc7d384544a2a9f11
Created April 24, 2015 18:51
incoming-webhook test
curl "YOUR_WEBHOOK" -d '{"text":"https://twitter.com/cdixon/status/591658510007410688"}'
Verifying that +seanrose is my openname (Bitcoin username). https://onename.io/seanrose
@seanrose
seanrose / monument-valley.md
Last active August 29, 2015 14:06
Monument Valley Theme for Slack

Copy and paste this into Preferences > Sidebar Theme

#348D9C,#2E838D,#F06335,#FFFFFF,#2E838D,#FFFFFF,#EC493C,#F79F63

### Keybase proof
I hereby claim:
* I am seanrose on github.
* I am seanrose (https://keybase.io/seanrose) on keybase.
* I have a public key whose fingerprint is 414D 0177 ADEF E44E CB6A 5B86 7F31 2ED7 9E65 4AC0
To claim this, I am signing this object:
@seanrose
seanrose / scrollspy.js
Last active December 17, 2015 11:09
Using JQuery to dynamically monitor the scroll bar/scroll position on a page.
// The JQuery scroll() function sets up a listener for scrolling on the selector you pass to it.
$( document ).scroll( function() {
// scrollTop gets the # of pixels from the top of the page
console.log( $( this ).scrollTop() );
});
@seanrose
seanrose / sampleBoxFileUpload.js
Last active October 28, 2022 20:16
A sample file upload in javascript to the Box API
// Requires JQuery and CORS enabled for the Origin you're testing from.
// Uncomment the next 4 lines to import JQuery
// var script= document.createElement('script');
// script.type= 'text/javascript';
// script.src= '//cdnjs.cloudflare.com/ajax/libs/jquery/2.0.0/jquery.min.js';
// document.head.appendChild(script);
// Set up the multipart form using HTML5 FormData object
// https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest/FormData
var form = new FormData();
@seanrose
seanrose / box_api.py
Created May 30, 2012 00:55
Making Your First Box API Call (Python)
import requests
#Set our API Key and the user's auth token (see http://developers.box.com/get-started/#authenticating)
api_key = YOUR_API_KEY
auth_token = YOUR_AUTH_TOKEN
auth_header = {'Authorization':
'BoxAuth api_key=%s&auth_token=%s' % (api_key, auth_token)}
#We're going to pull the contents of our account's root folder whose ID is '0'
api_url = 'https://api.box.com/2.0/'