Skip to content

Instantly share code, notes, and snippets.

View jgable's full-sized avatar

Jacob Gable jgable

  • Making Other People Money
  • Redwood City, CA
  • X @jacob4u2
View GitHub Profile
@jgable
jgable / source1.js
Created February 12, 2014 18:50
Traceur Compiler Source Maps Examples
import { hello } from 'test1';
export var things = {
'1': 0,
'2': 0,
'3': 0,
updateThing: function (name, val) {
this[name] = val;
@jgable
jgable / derived.swift
Created June 12, 2014 19:55
Derived Class Method not ran
// Playground - noun: a place where people can play
import Cocoa
// Base class for parameters to POST to service
class APIParams {
func getData() -> Dictionary<String, AnyObject> {
return Dictionary<String, AnyObject>()
}
}
@jgable
jgable / permutations.js
Created September 15, 2014 14:53
Word Permutations
// To run with node: npm install lodash && node perms.js star
var _ = require('lodash'),
words = ['stars'];
function getPermutations(word) {
// Stop case for single character
if (word.length === 1) {
return [word];
}
@jgable
jgable / store.js
Created February 27, 2015 17:35
FluxBone Store with Dispatcher helpers
var dispatcher = require('./dispatcher');
/** @class Store */
var Store = Backbone.Collection.extend(/** @lends Store.prototype */ {
/**
* Instantiate a new store from the passed in models and options. Will attempt to load models
* from `getInitialData` if none are passed in.
*
* @constructor
@jgable
jgable / react-visualstatemanager-notes.md
Created May 6, 2015 04:36
Thoughts on React VisualStateManager

React VisualStateManager

A declarative visual state transition manager.

Wishlist

var { VisualStateComponent, VisualState, ColorAnimation } = require('vsm');
@jgable
jgable / EventToCommandTrigger.cs
Created February 22, 2011 18:58
ClickCommandTrigger from MVVMLight EventToCommand TriggerAction
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Input;
using GalaSoft.MvvmLight.Command;
public class ClickCommandTrigger : System.Windows.Interactivity.EventTriggerBase<Button>
{
/// <summary>
@jgable
jgable / CheckedItemCollection.cs
Created February 24, 2011 19:12
CheckedItemCollection for wrapping a collection of checkable items
using System.Collections.ObjectModel;
using System.Collections.Generic;
using System.Linq;
using System;
/// <summary>
/// A collection of checked items.
/// </summary>
/// <typeparam name="TItem">The type of the item.</typeparam>
public class CheckedItemCollection<TItem> : ObservableCollection<CheckedItemWrapper<TItem>>
@jgable
jgable / DragDropBehaviours.cs
Created February 24, 2011 21:01
An easy to implement DragDropBehavior for incorporating drag and drop in your silverlight 4 application; also includes a FileDragDropBehavior for easy file drag and drop
using System.IO;
using System.Windows;
using System.Windows.Input;
using System.Windows.Interactivity;
/// <summary>
/// A simple file drag and drop behavior.
/// </summary>
public class FileDragDropBehavior : DragDropBehavior<FileInfo[]>
{
@jgable
jgable / UpdateSourceOnTextChanged.cs
Created February 28, 2011 15:52
Updates a source binding for a TextBox when the text changes and not just when the box loses focus.
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Interactivity;
public class UpdateSourceOnTextChanged : Behavior<TextBox>
{
BindingExpression textBinding;
protected override void OnAttached()
{
@jgable
jgable / DataGridColumnBindableHeaderBehavior.cs
Created March 8, 2011 01:45
A simple behavior for adding a bindable column header to a DataGridTextColumn (or any other DataGridColumn)
using System.Windows;
using System.Windows.Controls;
using System.Windows.Interactivity;
public class BindableColumnHeader : Behavior<DataGridColumn>
{
/// <summary>
/// The <see cref="Header" /> dependency property's name.
/// </summary>
public const string HeaderPropertyName = "Header";