Skip to content

Instantly share code, notes, and snippets.

@timoxley
timoxley / Readme.md
Last active June 7, 2016 07:27
JS Pop Quiz: How well do you know your functions?

JS Pop Quiz: How well do you know your functions?

Given an Array of Functions fns, what argument(s) can you pass to fns.forEach such that each function in fns will execute, in order, without creating any anonymous (or named) functions or invoking the Function constructor?

Conditions

  • Do not use the function keyword, or arrow functions () => .
  • Do not invoke the Function constructor.
  • Do not use method definitions.
  • Function#bind & friends on the Function.prototype are ok.
@dstroot
dstroot / install-redis.sh
Created May 23, 2012 17:56
Install Redis on Amazon EC2 AMI
#!/bin/bash
# from here: http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/
# and here: https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server
###############################################
# To use:
# wget https://raw.github.com/gist/2776679/04ca3bbb9f085b192f6aca945120fe12d59f15f9/install-redis.sh
# chmod 777 install-redis.sh
# ./install-redis.sh
###############################################
echo "*****************************************"
@eqhmcow
eqhmcow / apache-logtop-README
Last active July 29, 2019 14:54
Real-time top-like requests-per-second average for httpd request logs - similar to apachetop
DESCRIPTION
logstat.pl and logtop.pl
These scripts show current and average request-per-second counts based on
apache access logs in real-time.
You can see the total requests-per-second as well as a breakdown by:
* vhost
* URL
@jistr
jistr / couch_fixture.rb
Created January 22, 2011 00:13
Simple YAML -> CouchDB fixture loader for Rails
# YAML -> CouchDB fixture loader for Rails
# ========================================
# by Jiri Stransky (http://twitter.com/jistr)
# for use with testing database instances only ;)
#
# What it does:
# * Loads fixtures from "test/fixtures" directory.
# * Permits use of ERB in the fixtures.
# * Uses CouchRest.
#
@ahoward
ahoward / net-http-debug.rb
Created December 10, 2010 20:06
a simple way to debug tons of libs that use ruby's net/http
BEGIN {
require 'net/http'
Net::HTTP.module_eval do
alias_method '__initialize__', 'initialize'
def initialize(*args,&block)
__initialize__(*args, &block)
@peterc
peterc / jetty
Created May 18, 2010 05:39
/etc/init.d/jetty
#!/usr/bin/env bash
#
# Startup script for jetty under *nix systems (it works under NT/cygwin too).
# To get the service to restart correctly on reboot, uncomment below (3 lines):
# ========================
# chkconfig: 3 99 99
# description: Jetty 7 webserver
# processname: jetty
# ========================