Skip to content

Instantly share code, notes, and snippets.

@tatey
tatey / 0_template.html
Created January 31, 2014 02:49
API I'd like to consume for uploading images to Cloudinary with AngularJS.
<div ng-controller="AvatarController">
<img ng-src="getImageUrl()" cloudinary open="imageDialogIsOpen" change="imageDidChange(url)">
<button ng-click="openImageDialog()">Change Avatar</button>
</div>
@tatey
tatey / gist:8793377
Last active August 29, 2015 13:56
Export `foo` to `window`.
(function (global) {
'use strict';
var foo = function () {
return this;
};
if (global.namespace === undefined) {
global.namespace = {};
}
%div{ng: {controller: 'planner.coverImageController', init: @plan.to_json}}
%img{ng: {src: 'getCoverImageUrl()'}}
// The cloudinary directive communicates with the cover image controller through `done`.
// When the fileuploaddone
%div{cloudinary: 'true', done: 'fileDidUpload(url)', timestamp: cloudinary_info.timestamp, corscallback: cloudinary_info.cors_callback, signature: cloudinary_info.signature, apikey: cloudinary_info.api_key}
exports.config = {
// The address of a running selenium server.
seleniumAddress: 'http://hub.browserstack.com/wd/hub',
// Capabilities to be passed to the webdriver instance.
capabilities: {
'browserName': 'chrome',
'browserstack.tunnel': 'true',
'browserstack.debug': 'true',
'browserstack.user' : process.env.BROWSERSTACK_USER,
@tatey
tatey / gist:10459627
Created April 11, 2014 11:19
script/e2e
#!/usr/bin/env ruby
#
# End to end tests.
#
# Starts the application server and BrowserStack tunnel in the background
# and then runs protractor. Stops the server and tunnel after protractor
# finishes.
require 'bundler/setup'
require 'dotenv'
app = angular.module 'dashboard'
app.animation '.appear', [->
addClass: (element, className, done) ->
$element = jQuery element
$element.removeClass className
$element.css 'opacity', 1
$element.animate {opacity: 0}, 300, 'linear', ->
$element.addClass className
done()
@tatey
tatey / gist:c5482ab8ea3ef24e6191
Created January 23, 2015 04:46
Ruby wrapper for public Nest API
require 'excon'
require 'json'
require 'uri'
module NestAPI
VERSION = '0.0.1'
class Default
def initialize(token)
@token = token
#!/usr/bin/env ruby
require 'pry'
require 'pathname'
if ARGV.count != 3
puts "usage: #{__FILE__} <TEMPLATE_IMAGE> <SOURCE_DIR> <DEST_DIR>"
exit(1)
end
#!/usr/bin/env ruby
require 'pry'
require 'pathname'
if ARGV.count != 3
puts "usage: #{__FILE__} <TEMPLATE_IMAGE> <SOURCE_DIR> <DEST_DIR>"
exit(1)
end
in macro 'macro_4595589792' /Users/Tate/Desktop/lifx-crystal/src/lifx/message/type.cr:11, line 5:
1.
2. case self
3.
4. when DeviceGetService
5. C::LXDeviceGetService
6.
7. when DeviceStateService
8. C::LXDeviceStateService