Skip to content

Instantly share code, notes, and snippets.

@esfand
esfand / Website.go
Created March 14, 2013 21:55
Go Website
// Based heavily on https://bitbucket.org/zombiezen/spdy, adapted for
// recent Go releases.
package main
import (
"crypto/tls"
"fmt"
"go.net/spdy"
"io"
package main
import (
"log"
"net/http"
"os"
"fmt"
)
// Environment variables
@esfand
esfand / cfm-pom.xml
Created May 18, 2013 19:10
HK2 Examples Maven POMs
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.glassfish.hk2</groupId>
<artifactId>ctm-example</artifactId>
<version>2.1.93</version>
<name>ctm-example</name>
package com.ontometrics.util;
import java.util.Calendar;
import java.util.Date;
/**
* Provides a fluent builder interface for constructing Dates and DateTimes.
*/
public class DateBuilder {
# Initial setup
git clone -o framework -b develop https://github.com/laravel/laravel.git project-name
cd project-name
git checkout --orphan master
git commit -m "Initial commit"
# Pulling changes
git fetch framework
git merge --squash -m "Upgrade Laravel" framework/develop
# Fix merge conflicts if any and commit
@esfand
esfand / app.js
Created June 9, 2013 03:25 — forked from fideloper/app.js
Javascript Module Sample
var Fancy = require('FancyModule');
var mod = new Fancy();
mod.on('success', function(data) {
console.log(data); // { this_is_fancy:'indubitably' }
});
<?php
class HookController extends Zend_Controller_Action {
public function preDispatch() {
$this->_helper->viewRenderer->setNoRender(true);
if (!$this->_request->isPost()) {
throw new Exception('POST required');
}
@esfand
esfand / loggly.conf
Created August 14, 2013 06:02 — forked from lox/loggly.conf
# loggly
source s_all {
file ("/proc/kmsg" log_prefix("kernel: "));
unix-stream ("/dev/log");
internal();
file("/mnt/log/apache2/error.log" follow_freq(1) flags(no-parse));
};
destination d_loggly {
tcp("logs.loggly.com" port(14791));
# /etc/rsyslog.conf Configuration file for rsyslog.
#
# For more information see
# /usr/share/doc/rsyslog-doc/html/rsyslog_conf.html
#
# Default logging rules can be found in /etc/rsyslog.d/50-default.conf
#################
#### MODULES ####
# this is a config sample for log normalization, but can
# be used as a more complex general sample.
# It is based on a plain standard rsyslog.conf for Red Hat systems.
#
# NOTE: Absolute path names for modules are used in this config
# so that we can run a different rsyslog version alongside the
# regular system-installed rsyslogd. Remove these path names
# for production environment.
#### MODULES ####