Skip to content

Instantly share code, notes, and snippets.

View hojberg's full-sized avatar
🔮
Building UIs for Unison

Simon Højberg hojberg

🔮
Building UIs for Unison
View GitHub Profile
@nhusher
nhusher / grunt-config.js
Last active December 17, 2015 08:18
A wrapper around the YUI3 Shifter build tool that lets you build YUI projects with grunt.
grunt.initConfig({
// Runs the YUI3 build tool on a directory. Docs: <http://yui.github.io/shifter/>
"shifter": {
"crm-src": {
// (optional) version - What to fill in on the "@VERSION@" field in built files
"version": "CRM",
// (optional) lint can be 'config' or false
// if "config", shifter will use the nearest .jshintrc JSON file as JSHint config
// if "false", shifter will skip the lint step entirely.
"lint" : "config",
@jshirley
jshirley / paged-model-list.js
Created August 28, 2012 17:49
An extension to mix-in to your ModelList to support pagination. Still WIP.
YUI.add('paged-model-list', function(Y) {
var NS = Y.namespace('BackOffice.Model'),
Lang = Y.Lang,
isString = Lang.isString,
isArray = Lang.isArray,
isObject = Lang.isObject;
function PagedList() { }
PagedList.prototype = {
@max-mapper
max-mapper / readme.md
Created August 19, 2012 05:18
put-a-closure-on-it

Put a closure on it

Sometimes you'll have objects that manage state along with event handling. This happens frequently in MVC apps. Let's start with a messy example:

var Launcher = function(rocket) {
  this.rocket = rocket
}

Launcher.prototype.isReady = function() {

@jshirley
jshirley / build.js
Created August 1, 2012 17:22
This is a setup I'm using with a YUI_config to leverage Y.Loader to build static rollup files.
/*
This is the Node.js file, it will export files directly to
`tdp-bundle-min.js` which obviously won't work well for you!
This relies on having a YUI_config that can be parsed and
passed into Y.Loader. Everything you need should be in this
gist, though. You may need to change the path to your
YUI_config file (mine is named `bundle.js`).
However, it's an easy change, just scroll down and edit it.
for i in $HOME/local/*; do
[ -d $i/bin ] && PATH="${i}/bin:${PATH}"
[ -d $i/sbin ] && PATH="${i}/sbin:${PATH}"
[ -d $i/include ] && CPATH="${i}/include:${CPATH}"
[ -d $i/lib ] && LD_LIBRARY_PATH="${i}/lib:${LD_LIBRARY_PATH}"
[ -d $i/lib ] && LD_RUN_PATH="${i}/lib:${LD_RUN_PATH}"
# uncomment the following if you use macintosh
# [ -d $i/lib ] && DYLD_LIBRARY_PATH="${i}/lib:${DYLD_LIBRARY_PATH}"
[ -d $i/lib/pkgconfig ] && PKG_CONFIG_PATH="${i}/lib/pkgconfig:${PKG_CONFIG_PATH}"
[ -d $i/share/man ] && MANPATH="${i}/share/man:${MANPATH}"
YUI.add('router', function(Y) {
/**
Provides URL-based routing using HTML5 `pushState()` or the location hash.
@module app
@submodule router
@since 3.4.0
**/
@ericf
ericf / app.js
Created May 18, 2012 14:49
Nest Y.App POC
YUI({
modules: {
'router': {
fullpath: 'router-fixes.js',
requires: ['array-extras', 'base-build', 'history'],
optional: ['querystring-parse']
}
}
}).use('app-base', 'app-transitions', function (Y) {
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@passcod
passcod / _arrow_bx.scss
Created April 12, 2012 06:58
SCSS Arrow Please!
/* Coded by @passcod, MIT Licensed: passcod.mit-license.org
Adapted from @shojberg's cssarrowplease.com
*/
@mixin arrow-box( $selector: ".arrow-box",
$position: "top",
$arrow_size: 10px,
$border_width: 2px,
$box_color: #333,
$border_color: #ccc) {
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#