Skip to content

Instantly share code, notes, and snippets.

@kyleslattery
kyleslattery / ember_pluralize_helper.js
Last active August 29, 2015 13:59
Pluralize Helper for Ember
/*
{{pluralize someCount "person" "people"}}
When someCount == 1 => "1 person"
When someCount != 1 => "0 people", "10 people"
If the final argument is omitted, the plural is made by
appending an "s" to the second argument
@kyleslattery
kyleslattery / gist:8832799
Created February 5, 2014 20:51
URL to add a custom GIF search to Alfred

alfred://customsearch/Google%20GIF%20Search/gif/utf8/noplus/https://www.google.com/search?q={query}&tbm=isch&tbs=itp:animated

@kyleslattery
kyleslattery / graph.js
Created June 14, 2013 18:39
Resizable, zoomable D3 line chart
var padding = 0;
var data, xScale, yScale, line, area;
var prevChartWidth = 0, prevChartHeight = 0;
var data = [
[],[]
]
for (var y = 0; y<data.length; y++) {
var prev = 5;

Dev/Ops at Artisan Mobile

Here's what you need:

  • 4+ years of managing cloud-based infrastructures
  • Experience maintaining 24-7 high availability uptime and support
  • Experience leading teams and having primary responsibility for operational performance and communications
  • Experience with automated environment scripting
  • Solid experience with performance monitoring and tests
  • Experience managing and optimizing big data deployments
  • Strong interpersonal and collaboration skills
# Description:
# Annyong
#
# Dependencies:
# None
#
# Configuration:
# None
#
# Commands:
@kyleslattery
kyleslattery / darksky.coffee
Created January 10, 2013 03:25
Hubot script for getting current weather/forecast from Dark Sky
# Description
# Grabs the current forecast from Dark Sky
#
# Dependencies
# None
#
# Configuration
# HUBOT_DARK_SKY_API_KEY
# HUBOT_DARK_SKY_DEFAULT_LOCATION
#
diff --git a/Sensible Table View/SCTableViewCell.m b/Sensible Table View/SCTableViewCell.m
index a828c53..b1c35d2 100644
--- a/Sensible Table View/SCTableViewCell.m
+++ b/Sensible Table View/SCTableViewCell.m
@@ -1856,8 +1856,17 @@
{
if([numericValue intValue]==0 && self.displayZeroAsBlank)
self.textField.text = nil;
- else
- self.textField.text = [NSString stringWithFormat:@"%@", numericValue];
<?php
include('phpviddler.php');
$user = 'YOUR USERNAME';
$pass = 'YOUR PASSWORD';
$api_key = 'YOUR API KEY';
$callback_url = 'CALLBACK';
$v = new Viddler_V2($api_key);
require 'rubygems'
require 'viddler-ruby'
# Create the client and authenticate it
viddler = Viddler::Client.new 'YOUR API KEY'
viddler.authenticate! 'USERNAME', 'PASSWORD'
# Simple API for calling GET, POST, and uploading a file:
viddler.get 'viddler.playlists.getByUser', :user => 'kyleslat'
function viddlerVideoSwitch(objectElement, newId) {
viddlerVideoInterface(objectElement, function(movie){
movie.setMovie(videoId, true);
}, function(video){
video = $(video);
var src = video.attr('src');
var poster = video.attr('poster');
var oldId = src.match(/file\/([^\/]+)\/html5/)[1];
var oldIdRegexp = new RegExp(oldId);
video.attr('src', src.replace(oldIdRegexp, newId));