This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function curry$(f, bound){ | |
var context, | |
_curry = function(args) { | |
return f.length > 1 ? function(){ | |
var params = args ? args.concat() : []; | |
context = bound ? context || this : this; | |
return params.push.apply(params, arguments) < | |
f.length && arguments.length ? | |
_curry.call(context, params) : f.apply(context, params); | |
} : f; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{map, unique, flatten} = require \prelude-ls | |
# Helpers | |
# | |
joinF = (f, g) --> | |
-> | |
(f ...) ++ g ... | |
maybe = (pred, f, x) --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('funcoffee').expose global | |
#- Monadic | |
unit = curry (x, a) -> new x.constructor a | |
mbind = curry (f, ma) -> ma.bind f | |
mjoin = (ma) -> ma.bind id | |
fmap = curry (f, ma) -> ma.bind (a) -> unit ma, f a | |
ap = curry (mf, ma) -> mf.bind (f) -> fmap f, ma |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var formatObj = function(data, obj) { | |
return Object.keys(obj).reduce(function(acc, k) { | |
acc[data[k.match(/#\{(\w+)\}/)[1]]] = obj[k] | |
return acc | |
},{}) | |
} | |
formatObj({a:'foo', b:'baz'}, {'#{a}': 'this is foo' | |
,'#{b}': 'this is baz'}) | |
//^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var add,all,andF,any,apply,builtin,capitalize,compact,compose,concat,concatF,countBy,curry,curryN,difference,div,drop,dups,each,even,extend,filter,find,first,flatMap,flatten,flip,flip3,flipN,fold,foldr,forOwn,gmatch,groupBy,gt,gte,has,id,inArray,initial,instanceOf,intersection,isF,isType,isntF,join,keys,last,lt,lte,map,match,max,memo,merge,min,mod,mul,nop,notF,odd,orF,pairs,partial,partition,pluck,pluckF,pluckR,reject,replace,rest,reverse,search,sequence,shuffle,size,slice,sort,sortBy,split,sub,substr,take,toArray,toLower,toObject,toUpper,trim,union,unique,unwords,unzipObject,values,variadic,where,withF,words,zip,zipObject,zipWith,_,__slice=[].slice,__indexOf=[].indexOf||function(e){for(var t=0,n=this.length;t<n;t++){if(t in this&&this[t]===e)return t}return-1},__hasProp={}.hasOwnProperty;_={};nop=function(){};id=function(e){return e};builtin=function(e){return nop.call.bind(e)};variadic=function(){var e;e=1<=arguments.length?__slice.call(arguments,0):[];return e};apply=function(){var e,t;t=arguments[0],e=2<= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass[oneside,12pt]{article} | |
%\usepackage[margin=1.55in]{geometry} | |
\usepackage[english]{babel} | |
\usepackage[T1]{fontenc} | |
\usepackage{ | |
listings,titlesec,sectsty,setspace, | |
enumerate,tabularx, | |
graphicx,fancyhdr,framed, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass[oneside,12pt]{article} | |
\usepackage[english]{babel} | |
\usepackage[T1]{fontenc} | |
\usepackage{ | |
listings,titlesec,sectsty,setspace,caption, | |
enumerate,tabularx, | |
graphicx,fancyhdr,framed, | |
microtype,ragged2e, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.fn.toCustomFile = function () { | |
return this.each(function () { | |
var | |
$file = $(this), // The file input | |
// Necessary markup | |
$wrap = $('<div class="wrap">'), | |
$input = $('<input type="text" class="filename" />'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*-------------------------------------------------------------------------- | |
jq-idealforms 2.0 | |
* Author: Cedric Ruiz | |
* License: GPL or MIT | |
* Demo: http://elclanrs.github.com/jq-idealforms/ | |
* | |
--------------------------------------------------------------------------*/(function(e){"use strict";e.idealforms={};var t={getMaxWidth:function(t){var n=0;return t.each(function(){e(this).outerWidth()>n&&(n=e(this).outerWidth())}),n},getLessVar:function(t,n){var r=e('<p class="'+t+'"></p>').hide().appendTo("body").css(n);return e("."+t).remove(),/^\d+/.test(r)?parseInt(r,10):r},getKeys:function(e){var t=[];for(var n in e)t.push(n);return t},isFunction:function(e){return typeof e=="function"},isRegex:function(e){return e instanceof RegExp},getByNameOrId:function(t){if(e('[name="'+t+'"]').length)return e('[name="'+t+'"]');if(e('[name="'+t+'"]').length)return e("#"+t);e.error('The field "'+t+"\" doesn't exist.")},getIdealType:function(e){var t=e.attr("type")||e[0].tagName.toLowerCase();return/(text|password|em |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A custom <select> menu jQuery plugin | |
* @example `$('select').idealSelect()` | |
*/ | |
$.fn.idealSelect = function () { | |
return this.each(function () { | |
var |
OlderNewer