Skip to content

Instantly share code, notes, and snippets.

@nolastan
nolastan / index.haml
Created April 11, 2014 01:33
CSS/SASS Speech Bubbles
.quote
%img.round-avatar{src: 'https://s3.amazonaws.com/uifaces/faces/twitter/stan/48.jpg'}
.speech-bubble
%p
Stanford R.
%span.time-ago
2 minutes ago
%blockquote
"Join me on SaveUp and start being rewarded for saving money!"
@nolastan
nolastan / gist:e684753793095a23a819
Created June 1, 2015 23:05
Sketch.app – apply a shared style
var doc = context.document;
var docLayerStyles = [[doc documentData] layerStyles];
var numObjects = [docLayerStyles numberOfSharedObjects];
var sharedStyle = [docLayerStyles sharedObjectAtIndex: 0];
var layer = context.selection[0];
layer.setStyle(sharedStyle.newInstance());
@nolastan
nolastan / gist:fe69695d60cd04395c2e
Created June 19, 2015 19:25
Sketch.app – import styles from airtable
var doc = context.document;
var buttons = getButtons();
for (var i=0; i < buttons.length; i++) {
attrs = buttons[i].fields;
var button = createButton(attrs);
doc.currentPage().addLayers([button]);
}
function getButtons() {
var request = NSMutableURLRequest.new();
stanford-rosenthals-macbook-pro:attendit stan$ bundle install
NOTE: Gem::Specification#default_executable= is deprecated with no replacement. It will be removed on or after 2011-10-01.
Gem::Specification#default_executable= called from /Users/stan/.gem/ruby/1.8/specifications/erubis-2.6.6.gemspec:10.
NOTE: Gem::Specification#default_executable= is deprecated with no replacement. It will be removed on or after 2011-10-01.
Gem::Specification#default_executable= called from /Users/stan/.gem/ruby/1.8/specifications/erubis-2.7.0.gemspec:10.
NOTE: Gem::Specification#default_executable= is deprecated with no replacement. It will be removed on or after 2011-10-01.
Gem::Specification#default_executable= called from /Users/stan/.gem/ruby/1.8/specifications/rack-1.2.2.gemspec:10.
NOTE: Gem::Specification#default_executable= is deprecated with no replacement. It will be removed on or after 2011-10-01.
Gem::Specification#default_executable= called from /Users/stan/.gem/ruby/1.8/specifications/rake-0.8.7.gemspec:10.
NOTE:
@nolastan
nolastan / gemfile
Created May 6, 2011 03:21
Stan's gemfile
source 'http://rubygems.org'
gem 'rails', '3.0.7'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'mysql'
# Use unicorn as the web server
require 'rubygems'
require 'nokogiri'
@nolastan
nolastan / trapi_callback
Created September 6, 2012 23:55
taskrabbit callback data example
{
"items" : [
{
"actor" : {
// user info: who made the offer
},
"created_at" : 1334797665,
"event_type" : "offer_sent", # or offer_made
"offer": {
// offer info
@nolastan
nolastan / gist:3691669
Created September 10, 2012 15:47
tr_python
# Use the py_oauth2 library
# https://github.com/liluo/py-oauth2
from py_oauth2 import oauth2
task_rabbit_client = oauth2.Client(TASK_RABBIT_KEY, TASK_RABBIT_SECRET,
site='https://taskrabbitdev.com',
authorize_url='https://taskrabbitdev.com/api/authorize',
token_url='https://taskrabbitdev.com/api/oauth/token',
header_format= 'OAuth %s')
task_rabbit_access = oauth2.AccessToken(client=task_rabbit_client, token=TASK_RABBIT_ACCESS_TOKEN, header_format= 'OAuth %s')
@nolastan
nolastan / trapi-node
Created September 24, 2012 19:23
node.js taskrabbit api example
var action = {};
/////////////////////////////////////////////////////////////////////
// metadata
action.name = "oauth-taskrabbit-callback";
action.description = "";
action.inputs = {
"required" : ["code"],
"optional" : []
};
@nolastan
nolastan / rough-circle.cocoascript
Last active October 18, 2015 23:55
Creates a really rough circle out of curves
var color = "#dd0000";
var doc = context.document;
var path = NSBezierPath.bezierPath();
var unit = 20;
path.moveToPoint(NSMakePoint(0,0));
[path curveToPoint:NSMakePoint(2*unit,-2*unit) controlPoint1:NSMakePoint(unit,0) controlPoint2:NSMakePoint(2*unit,-unit)];
[path curveToPoint:NSMakePoint(0,-4*unit) controlPoint1:NSMakePoint(2*unit,-3*unit) controlPoint2:NSMakePoint(unit,-4*unit)];
[path curveToPoint:NSMakePoint(-2*unit,-2*unit) controlPoint1:NSMakePoint(-unit,-4*unit) controlPoint2:NSMakePoint(-2*unit,-3*unit)];