Skip to content

Instantly share code, notes, and snippets.

View sukima's full-sized avatar

Devin Weaver sukima

View GitHub Profile
@benkitzelman
benkitzelman / safeRead.js
Last active December 16, 2015 03:49
A safe format function to read deeply nested properties (i.e. my.nested.value)... If any property in the chain is null or undefined, an empty string will be returned
//
// Usage... for a nested structure
// var test = {
// nested: {
// value: 'Read Correctly'
// }
// };
// safeRead(test, 'nested', 'value'); // returns 'Read Correctly'
// safeRead(test, 'missing', 'value'); // returns ''
//
@aaronksaunders
aaronksaunders / app_snippet.js
Last active July 11, 2020 14:07
One way to do bulk updates and deletes with Appcelerator Alloy Collections
// add all items to collection
Alloy.Collections.Fugitive.reset([{
"name" : "Jeff Haynie"
}, {
"name" : "Nolan Wright"
}, {
"name" : "Don Thorp"
}, {
"name" : "Marshall Culpepper"
}, {
@sukima
sukima / README.md
Last active December 12, 2015 00:28 — forked from neoGeneva/gist:1309070

Super Simple Event Dispatcher

Use this to add events to your objects without needing any libaries.

Simple function can be imported or copy pasted. In your object constructor assign your event functions to the return value of the createCustomEvent().

Simple example:

@sukima
sukima / jsbin_settings.js
Last active December 11, 2015 23:38
My personalized settings for JSBin.com
(function(settings, libraries) {
localStorage.setItem('settings', JSON.stringify(settings));
localStorage.setItem('libraries', JSON.stringify(libraries));
setTimeout(function() {
window.location = window.location; // Force refresh
}, 0);
})(
//Settings
{
"panels": [
@polotek
polotek / ember_hurdles.md
Last active March 30, 2017 05:37
Hurdles getting started with Ember.js

This is a brain dump of my experience trying to get something going with Ember.js. My goal was to get to know the ins and outs of the framework by completing a pretty well defined task that I had lots of domain knowledge about. In this case reproducing a simple Yammer feed. As of this time, I have not been able to complete that task. So this is a subjective rundown of the things I think make it difficult to get a handle on Ember. NOTE: My comments are addressing the Ember team and giving suggestions on what they could do to improve the situation.

App setup

The new guides have pretty good explanation of the various parts of the framework; routers, models, templates, views. But it's not clear how they all get strapped together to make something that works. There are snippets of examples all over the place like:

App.Router.map(function() {
  match('/home').to('home');
});
@domenic
domenic / promises.md
Last active April 1, 2025 01:54
You're Missing the Point of Promises

This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.

You're Missing the Point of Promises

Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:

getTweetsFor("domenic", function (err, results) {
 // the rest of your code goes here.
@tlberglund
tlberglund / photos_tag.rb
Created September 30, 2012 20:28 — forked from sukima/photos_tag.rb
Jekyll Plugin for easy FancyBox usage
# Title: Photos tag for Jekyll
# Authors: Devin Weaver
# Description: Allows photos tag to place photos as thumbnails and open in fancybox. Uses a CDN if needed.
#
# ** This only covers the markup. Not the integration of FancyBox **
#
# To see an unabridged explination on integrating this with [FancyBox][1]
# Please read my [blog post about it][2].
#
# [1]: http://fancyapps.com/fancybox/

Project

Description: What does this project do and who does it serve?

Project Setup

How do I, as a developer, start working on the project?

  1. What dependencies does it have (where are they expressed) and how do I install them?
  2. How can I see the project working before I change anything?
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@sukima
sukima / solarized.sh
Created April 27, 2012 15:01
A convinient one stop solorized install for gnome-terminal
#!/usr/bin/env bash
# Gist: https://gist.github.com/2509971
#
# This is a psuedo-fork of [gnome-terminal-colors=solarized][1]
# The values were hard coded (where the above was modularized) for
# ease of using curl or wget to pull from a gist.
#
# curl https://raw.github.com/gist/2509971/solarized.sh | bash -s
#