Skip to content

Instantly share code, notes, and snippets.

@josephj
josephj / gulpfile.coffee
Last active August 29, 2015 14:08
Development tools for developer portal project
################
# Dependencies
################
gulp = require 'gulp'
watch = require 'gulp-watch'
connect = require 'gulp-connect'
open = require 'gulp-open'
path = require 'path'
exec = require('child_process').exec
################
@josephj
josephj / .gitconfig
Last active August 29, 2015 14:20
Basic .gitconfig file
[alias]
st = status
br = branch
ci = commit
cp = cherry-pick
co = checkout
sub = submodule
[diff]
color = auto
@curtisharvey
curtisharvey / loader.js
Created July 29, 2010 06:55
YUI seed loader
/**
* Light-weight YUI-dependend Script Loader
* - loads YUI 3 if not already loaded
* - then loads your script(s)
*
* Useful for dynamically loaded modules, injected scripts, bookmarklets, etc…
*/
(function() {
// YUI to load if unavailable
@kara-ryli
kara-ryli / implementation.js
Created July 8, 2011 20:01
Create a singleton class in YUI3. This class can only be instantiated one time. All later instantiations return references to the original.
YUI().use("singleton-class", function (Y) {
var instance1 = new Y.SingletonClass(),
instance2 = new Y.SingletonClass();
Y.log(instance1 === instance2); // true!
window.instance1 = instance1;
});
YUI().use("singleton-class", function (Y) {
@josephj
josephj / debugging.js
Created November 28, 2011 03:51
Remove unecessary JavaScript logs, for debugging purpose.
YUI_config = {
logInclude : {
"ID3": true
}
};
if (typeof console !== "undefined") {
console.log = function (m, t, s) {
s = s || null;
if (!s) {
return false;
@davidmfoley
davidmfoley / coffeelint.vim
Created April 2, 2012 14:07
coffeelint/vim quickfix integration
" Get coffeelint errors in the vim quickfix menu
" requires coffeelint to be installed and in the path
" http://www.coffeelint.org/
" lint the current file
function! CoffeeLintFile()
let current = fnamemodify(expand("%"), ':p')
call CoffeeLintAnalyze(current)
endfunction
@josephj
josephj / mask.scss
Created October 19, 2012 02:50
A pure CSS mask which centralizes content inside. ( http://josephj.com/lab/2012/mask/demo.html )
@import "compass";
/**
* A pure CSS mask which centralizes content inside.
* This technique is compatible with IE7+ and major standard browsers.
*
* Required HTML structure:
*
* <div class="mask">
* <div class="mask-box">
* <div class="mask-inner-box">
@timkelty
timkelty / selects.js
Created February 19, 2015 16:39
Custom select2 adapter
// jshint maxparams: 8
define([
'jquery',
'fmjs/amd/src/fm.timer',
'Select2/src/js/select2/utils',
'Select2/src/js/select2/dropdown',
'Select2/src/js/select2/dropdown/attachContainer',
'Select2/src/js/select2/dropdown/search',
'Select2/src/js/select2/dropdown/minimumResultsForSearch',
'Select2/src/js/jquery.select2',
@dannvix
dannvix / Sorting-Color-Nodes-by-Hue.html
Last active December 19, 2015 22:49
Simple visualization for sorting color nodes by hue
<!DOCTYPE html>
<html>
<head>
<title>Sorting Color Nodes by Hue</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
overflow: hidden;
background: #333333;
}
@andrewgleave
andrewgleave / AnimatableComponent.js
Last active November 27, 2018 20:41
Keyframe animation support for React. Enables integration between React components and JS animation events.
/** @jsx React.DOM */
'use strict';
var React = require('react');
var AnimatableComponent = React.createClass({
propTypes: {
tag: React.PropTypes.component.isRequired,