Skip to content

Instantly share code, notes, and snippets.

This file has been truncated, but you can view the full file.
var dictionary = ["aa",
"aah",
"aahed",
"aahing",
"aahs",
"aal",
"aalii",
"aaliis",
"aals",
"aardvark",
@ndhoule
ndhoule / publicity
Last active December 16, 2015 08:29
#!/usr/bin/env bash
ORGNAME="hackreactor"
GIT_CREDENTIAL_HELPER=$(git config --global --get credential.helper)
REPOS=('layout' 'twittler' 'paybuddy' 'data-structures' 'n-queens' 'more-data-structures' 'javascript_koans' 'subclass-dance-party' 'underbar' 'mytunes' 'chat-server' 'chat-client' 'recursion' 'regexen' 'web-historian' 'blackjack' 'databases' 'more-databases' 'meteor')
github_username=0
github_password=0
spacedPrint() {
/**
* Appointment
*
* @module :: Model
* @description :: TODO
* @docs :: http://sailsjs.org/#!documentation/models
*/
module.exports = {
attributes: {
var floatingButtonDirective = function() {
return {
restrict: 'AE',
scope: {
text: '@'
},
template: '<div class="floating-button">Text: {{ text }}</div>'
};
};
@ndhoule
ndhoule / api\hooks\queue\index.js
Last active September 6, 2018 16:36
Trying to mount an Express app in Sails.js
'use strict';
var kue = require('kue');
var util = require('sails-util');
var ConfigurationError = function(message) {
this.name = 'ConfigurationError';
this.message = message || '';
};
ConfigurationError.prototype = Error.prototype;
/**
* Assignment.js
*/
module.exports = {
attributes: {
users: {
collection: 'user',
via: 'assignments',
dominant: true
}
// config/policies.js
module.exports = {
'*': false,
user: {
create: true,
find: true,
update: true,
destroy: true
},
@ndhoule
ndhoule / inject-jquery.js
Created May 20, 2014 01:23
jQuery bookmarklet
javascript:(function(global) {if (!global.jQuery) {var elem = document.createElement('script'); elem.src = '//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js'; document.getElementsByTagName('head')[0].appendChild(elem);}})(this); console.log('jQuery injected into page as `$` and `jQuery`.');
@ndhoule
ndhoule / getter-setter-example.js
Last active August 29, 2015 14:06
getter-setter-example.js
/**
* Example 1
*/
var Proto = Object.create(HTMLElement.prototype);
Proto.attachedCallback = function(){
// Using a generalized function is clearer and has many maintainability advantages IMHO
if(this.readAttributeAsJson('config-ready')){
// do something
var config = nodemonConf('cluster-web.js');
var newArgs = ['--debug'];
config.options.nodeArgs = Array.isArray(config.options.nodeArgs) ? config.options.nodeArgs.concat(newArgs) : newArgs;
grunt.initConfig({
nodemon: {
web: config,
objodb: nodemonConf('lib/objodb/objodbServer.js'),
topology: nodemonConf('lib/topology.js'),
scheduler: nodemonConf('lib/scheduler.js'),