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 disable_submit_button(obj) { | |
var selector = 'input[type="submit"]'; | |
var in_sub; | |
if (!obj) { | |
in_sub = document.querySelectorAll(selector); | |
} else { | |
var in_sub = obj.querySelectorAll(selector); | |
} | |
setTimeout(function(){ | |
if (in_sub) { |
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 Q = require('q'), | |
fs = require('fs'); | |
Q.longStackSupport = true; | |
var filterLargeFilename = function (array) { | |
var length = 10; | |
return array.filter(function (name) { | |
return (name.length <= length); |
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
// USERS | |
world.changed.users.forEach(saveUser); | |
world.changed.users = []; | |
// TARGETS | |
world.changed.targets.forEach(function(target){ | |
if (target.remove == true){ | |
deleteTarget(target); | |
} |
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
angular.module('app.common.directives.html-editor', []) | |
.directive('htmlEditor', function() { | |
return { | |
restrict: 'E', | |
scope: { | |
'html': '=' | |
}, | |
link: function (scope, element, attrs, ctrl) { | |
// this is a browserify bundle where my react components live |
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 set(obj, keys, value){ | |
// for empty or undefined paths, just assume root | |
if (!keys) { | |
return obj; | |
} | |
var parts = keys.split("."), o = obj; | |
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 Events() { | |
var self = this; | |
self.events = {}; | |
self.on = function(event, callback, context) { | |
self.events.hasOwnProperty(event) || (self.events[event] = []); | |
self.events[event].push([callback, context]); | |
}; | |
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
<div id="main"/> | |
<script type="text/jsx"> | |
/** @jsx React.DOM */ | |
var DragItem = React.createClass({ | |
drag: function(ev) { | |
ev.dataTransfer.setData("draggedItem", JSON.stringify(this.props.item)); | |
}, | |
render: function () { | |
return (<div draggable="true" onDragStart={this.drag} className="item">{this.props.item.text}</div>); | |
} |
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
'use strict'; | |
app.factory('Gapi', ['$q', function($q) { | |
var loaded = false, loading = false; | |
function makeRequest() { | |
// do it later if we're not loaded yet | |
if (!loaded) { | |
return load().then(makeRequest); | |
} |
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 x = require("./fnord"); | |
module.exports = function foo() { | |
console.log(x(1, 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
var mysql = require('../lib/db'); | |
var pub = { | |
authorize:function(uid,origin, cb){ | |
mysql.getConnection(function(err, connection) { | |
if (err){ return cb(err); } | |
// Use the connection | |
connection.query('SELECT secret_key,domain_name FROM rs_eshop_auth WHERE secret_key = ?',uid, function(err, rows) { | |
if (err){ return cb(err); } |
OlderNewer