This file contains hidden or 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
/* | |
The MIT License (MIT) | |
Copyright (c) 2013 Zulfa Juniadi | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
This file contains hidden or 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
#!/bin/bash | |
# usage: nwbuild [appname] [version] | |
if [ ! -f package.json ]; then | |
echo "File package.json not found!" | |
exit; | |
fi | |
# todo prompt form resources |
This file contains hidden or 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
/* override bootstrap popover to include callback */ | |
var showPopover = $.fn.popover.Constructor.prototype.show; | |
$.fn.popover.Constructor.prototype.show = function() { | |
showPopover.call(this); | |
if (this.options.showCallback) { | |
this.options.showCallback.call(this); | |
} | |
} |
This file contains hidden or 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
<?php | |
/* Base Controller Example */ | |
class BaseController | |
{ | |
protected function _format_name($column, $row) | |
{ | |
return strtoupper($column); | |
} |
This file contains hidden or 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(a,b,c,d){function e(d){if(!c[d]){if(!b[d]){if(a)return a(d);throw new Error("Cannot find module '"+d+"'")}var f=c[d]={exports:{}};b[d][0](function(a){var c=b[d][1][a];return e(c?c:a)},f,f.exports)}return c[d].exports}for(var f=0;f<d.length;f++)e(d[f]);return e}("undefined"!=typeof require&&require,{1:[function(a,b){var d,e,f,g,h,i=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1};h=a("../lib/lodash.js"),g=a("./helpers"),e=a("./context"),f={},f.render=function(a,b,c,d){var i,j;return null==b&&(b=[]),null==c&&(c={}),null==d&&(d={}),i=d.debug&&console?g.consoleLogger:g.nullLogger,i("Transparency.render:",a,b,c,d),a?(h.isArray(b)||(b=[b]),a=(j=g.data(a)).context||(j.context=new e(a,f)),a.render(b,c,d).el):void 0},f.matcher=function(a,b){return a.el.id===b||i.call(a.classNames,b)>=0||a.el.name===b||a.el.getAttribute("data-bind")===b},f.clone=function(a){return d(a).clone()[0]},f.jQueryPlugin=g.chainable(function(a,b,c){var d,e,g,h;for(h=[],e=0,g=this.l |
This file contains hidden or 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
Deps.autorun(function(){ | |
Template.modal.html = function(){ | |
return Template['modal' + Session.get('modalName')](); | |
} | |
}) | |
showModal = function(templateName) { | |
Session.set('modalName', templateName); | |
setTimeout(function(){ |
This file contains hidden or 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.serializeObject = function() | |
{ | |
var o = {}; | |
var a = this.serializeArray(); | |
var form = $(this); | |
$.each(a, function() { | |
var input = form.find('[name="'+this.name+'"]'); | |
var multiple = $(input).attr('multiple'); | |
if (multiple) { | |
o[this.name] = o[this.name] || []; |
This file contains hidden or 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
<?php | |
class HandlebarsCompile | |
{ | |
private static $tmpFile = 'cache/handlebarscompile.txt'; | |
private static $templateFiles = 'views/templates/*'; | |
private static $outputFile = 'assets/js/templates.js'; | |
public static function Check() { | |
$tmpFile = self::$tmpFile; |
This file contains hidden or 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
// jQuery Connect v0.0.1 | |
// (c) Zulfa Juniadi <http://zulfait.blogspot.com/> | |
// Usage : var connection = $.connect('#elem1', '#elem2', {options}); | |
// Documentation : http://zulfait.blogspot.com/2013/07/jquery-connect.html | |
// Source : https://gist.github.com/zulfajuniadi/5928559#file-jquery-connect-js | |
// Requires : jQuery v1.9+ (Older versions may work, but not tested) | |
// Suggests : jQuery UI (It works with draggable elements!) | |
// MIT License | |
;(function($) { |
This file contains hidden or 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 makeId() | |
{ | |
var text = ""; | |
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; | |
for( var i=0; i < 5; i++ ) | |
text += possible.charAt(Math.floor(Math.random() * possible.length)); | |
return text; | |
} |