Skip to content

Instantly share code, notes, and snippets.

@jordansissel
jordansissel / apachedashboard.json
Created March 21, 2014 23:09
Kibana 3.0.0 dashboard for Apache access logs w/ default 'combined' apache log format. Parsed with logstash 1.4.0 using grok, date, geoip, and useragent filters.
{
"title": "Apache Overview",
"services": {
"query": {
"list": {
"2": {
"id": 2,
"type": "topN",
"query": "",
"alias": "",
@nodesocket
nodesocket / logstash
Created July 7, 2013 01:18
LogStash init.d service script.
#! /bin/sh
#
# /etc/rc.d/init.d/logstash
#
# Starts Logstash as a daemon
#
# chkconfig: 2345 20 80
# description: Starts Logstash as a daemon
### BEGIN INIT INFO
@domenic
domenic / promises.md
Last active February 6, 2025 16:34
You're Missing the Point of Promises

This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.

You're Missing the Point of Promises

Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:

getTweetsFor("domenic", function (err, results) {
 // the rest of your code goes here.
@michaelcox
michaelcox / SpecRunner.js
Last active October 12, 2024 17:11
Browser Unit Testing with Backbone Mocha Chai and RequireJS
require.config({
baseUrl: '/backbone-tests/',
paths: {
'jquery' : '/app/libs/jquery',
'underscore' : '/app/libs/underscore',
'backbone' : '/app/libs/backbone',
'mocha' : 'libs/mocha',
'chai' : 'libs/chai',
'chai-jquery' : 'libs/chai-jquery',
'models' : '/app/models'
@umpirsky
umpirsky / FormServiceProvider.php
Created September 27, 2012 10:25
Register custom form field type in Silex
<?php
$this->share($this->extend('form.factory', function (FormFactoryInterface $factory) {
$factory->addType(new MyType());
return $factory;
}));
@ypchen
ypchen / gist:3187714
Created July 27, 2012 12:33
Create a VM to Install Ubuntu 12.04 LTS 64-bit Server on XenServer/XCP
References:
[1] http://www.virtualzone.de/2012-05-01/ubuntu-12-04-on-citrix-xenserver-5-6/
[2] http://thetechshop.org/showthread.php?847-Citrix-Xenserver-Template-for-Ubuntu-12.04-and-the-weird-Rebooting-to-Read-Only-Mode
Steps:
1. New VM
* Two choices:
@thelonecabbage
thelonecabbage / recursive.tojson for backbone
Created March 12, 2012 08:31
Recursive toJSON for Backbone.js
Data.Model = Backbone.Model.extend({
toJSON: function(){
var clone = _.clone(this.attributes);
_.each(clone, function (attr, idx) {
if(attr.toJSON){
clone[idx] = attr.toJSON();
}
});
return clone;
}