Skip to content

Instantly share code, notes, and snippets.

@aescarcha
aescarcha / nodeAsyncTest.js
Created September 25, 2018 07:03
Javascript async / await resolving promises at the same time test
// Simple gist to test parallel promise resolution when using async / await
function promiseWait(time) {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve(true);
}, time);
});
}
@adamschwartz
adamschwartz / instant-flat-ui.js
Last active December 27, 2015 15:39
"Instant" "Flat" "UI"™ — Run this bookmarklet on any page to make it "flat".
var d = document.createElement('div');
d.innerHTML = '\
<style>\
*:not(.icon):not(i), *:not(.icon):not(i):after, *:not(.icon):not(i):before {\
box-shadow: none !important;\
text-shadow: none !important;\
background-image: none !important;\
}\
*:not(.icon):not(i) {\
border-color: transparent !important;\
@bahamas10
bahamas10 / output.txt
Created August 28, 2012 19:58
figure out what is trying to write to a stream in node
Trace
at WriteStream.process.stdout.write (/Users/dave/dev/node-latest/index.js:4:11)
at Object.exports.log (console.js:25:18)
at Object.keys.forEach.console.(anonymous function) [as log] (/Users/dave/dev/node-latest/node_modules/log-timestamp/index.js:13:14)
at defaultCb (/Users/dave/dev/node-latest/node_modules/npm/lib/npm.js:205:16)
at Conf.done (/Users/dave/dev/node-latest/node_modules/npm/node_modules/npmconf/npmconf.js:218:15)
at Object.oncomplete (fs.js:297:15)
undefined
@Flushot
Flushot / backbone.js
Created April 28, 2012 09:41
Underscore.js 1.3.3 and Backbone.js 0.9.2 w/ AMD support (RequireJS)
// Backbone.js 0.9.2
// (c) 2010-2012 Jeremy Ashkenas, DocumentCloud Inc.
// Backbone may be freely distributed under the MIT license.
// For all details and documentation:
// http://backbonejs.org
// Use a factory function to attach Backbone properties to an exports value.
// Code at the end of this file creates the right define, require and exports
// values to allow Backbone to run in a CommonJS or AMD container or in the
@robinsmidsrod
robinsmidsrod / _INSTALL.md
Last active September 27, 2024 10:38
Bootstrapping full iPXE native menu with customizable default option with timeout (also includes working Ubuntu 12.04 preseed install)

Add the following chunk to your existing ISC dhcpd.conf file.

if exists user-class and ( option user-class = "iPXE" ) {
    filename "http://boot.smidsrod.lan/boot.ipxe";
}
else {
    filename "undionly.kpxe";
}

(or see https://gist.github.com/4008017 for a more elaborate setup

@robinsmidsrod
robinsmidsrod / ubuntu-amd64-installer.ipxe
Created March 27, 2012 08:52
Boot Ubuntu x64 installer directly from the network. Only iPXE needed
#!ipxe
dhcp
echo Starting Ubuntu x64 installer for ${hostname}
set base-url http://archive.ubuntu.com/ubuntu/dists/lucid/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64
kernel ${base-url}/linux
initrd ${base-url}/initrd.gz
#imgargs linux auto=true url=http://yourserver/some/path/preseed.cfg
boot ||
# If everything failed, give the user some options
echo Boot from ${base-url} failed
@jetztgradnet
jetztgradnet / eb-create-app.sh
Created February 3, 2011 02:43
Script to start an Amazon ElasticBeanstalk application with configuration parameters
#!/bin/sh
########################################################
# history
########################################################
#
# 0.3 (2011-02-08)
# - create/update configuration template 'InitialConfig' instead
# of 'Default', which is not editable
#
@billywhizz
billywhizz / lighttpd.conf
Created October 30, 2010 01:48
example of working fastcgi responder
fastcgi.server = ( ".js" =>
(( "socket" => "/tmp/js-fastcgi.socket",
"bin-path" => "/node-fastcgi/examples/responder.js",
"check-local" => "disable"
))
)
@shripadk
shripadk / gist:652819
Created October 29, 2010 03:10
Express authentication using Redis for session store and Couchdb for database (in coffeescript!)
###
Module dependencies
###
require.paths.unshift "#{__dirname}/lib/support/express-csrf/"
require.paths.unshift "#{__dirname}/lib/support/node_hash/lib/"
express = require 'express'
app = module.exports = express.createServer()
RedisStore = require 'connect-redis'
<?php
/**
* SplClassLoader implementation that implements the technical interoperability
* standards for PHP 5.3 namespaces and class names.
*
* http://groups.google.com/group/php-standards/web/final-proposal
*
* // Example which loads classes for the Doctrine Common package in the
* // Doctrine\Common namespace.