Skip to content

Instantly share code, notes, and snippets.

View nickjs's full-sized avatar

Nicholas J. Small nickjs

View GitHub Profile
@nickjs
nickjs / mesh.coffee
Last active August 29, 2015 13:57
parallel transport frames wtf
totalLength = Math.ceil(@model.spline.getLength())
up = LW.UP.clone()
rolledUp = up.clone()
binormal = new THREE.Vector3
bank = lastBank = 0
for i in [0..totalLength]
u = i / totalLength
@nickjs
nickjs / gist:6999202
Last active December 25, 2015 15:38 — forked from benjskim/gist:6999177
$(function() {
var aboutTextIsExpanded = false;
$(".moreabout").click(function(){
$(".moreabouttext").slideToggle();
if (aboutTextIsExpanded)
$(".moreabout").text("Read Less");
else
$(".moreabout").text("Read More");
});
});
{
"bold_folder_labels": true,
"color_scheme": "Packages/User/Espresso Soda.tmTheme",
"ensure_newline_at_eof_on_save": true,
"fade_fold_buttons": false,
"font_face": "Mensch",
"font_size": 26.0,
"highlight_line": true,
"highlight_modified_tabs": true,
"ignored_packages":
@nickjs
nickjs / CHANGELOG.md
Last active December 13, 2015 18:48
batman.js 0.14.0 changelog

https://github.com/Shopify/batman/compare/v0.13.0...master

APP

  • Added: App.shouldAllowEvent.[event]. Callbacks in this hash will be called whenever the corresponding data-event is fired from anywhere within the app. Return false to prevent app-level propagation. For example:
class MyApp extends Batman.App
  @shouldAllowEvent.click = (event) ->
    return false
@nickjs
nickjs / stupid.js
Created June 7, 2012 07:06
Infinite Picture Generator
(function() {
var canvas = document.getElementById('canvas');
var MAX_ROWS = canvas.height;
var MAX_COLS = canvas.width;
var code = "var context = document.getElementById('canvas').getContext('2d');var color;\n";
var magicNumber = 255/5;
var pixelCount = 0;
class Shopify.ProductsIndexView extends Batman.View
# should be YourApp.ControllerActionView
ready: ->
$('span').slider()
@nickjs
nickjs / uselessthing.coffee
Created September 20, 2011 22:40
A totally useless way to use CoffeeScript
c = (obj) ->
(callback) ->
callback.call(obj)
foo = c 'bar'
alert foo -> @length
random = c foo: c 'bar'
alert random -> @foo -> @[0]
@nickjs
nickjs / observable_test.coffee
Created May 26, 2011 19:16
Use case for extended or something similar.
###
# Use case for `extended` or something similar.
###
# Library Code
# mixin helper
mixin = (to, object) ->
for key, value of object
to[key] = value
@nickjs
nickjs / classbug.coffee
Created April 29, 2011 16:21
PARSE ERROR ON LINE 2: UNEXPECTED ','
class User extends Object
foo: @property 'bar', ->
console.log 'foo'
@nickjs
nickjs / CPUserDefaults.j
Created November 1, 2010 21:31
CPUserDefaults
/*
* CPUserDefaults.j
* Foundation
*
* Created by Nicholas Small.
* Copyright 2010, 280 North, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either