Skip to content

Instantly share code, notes, and snippets.

ando dre1080

Block or report user

Report or block dre1080

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View box-shadow.html
<!DOCTYPE html>
<html>
<head>
<title>Box Shadow</title>
<style>
.box {
height: 150px;
width: 300px;
margin: 20px;
@dre1080
dre1080 / gist:988488
Created May 24, 2011
Simple ini parser
View gist:988488
$debug = function($var, $exit = true) {
echo '<pre>';
(is_array($var) || is_object($var)) ? print_r($var) : var_dump($var);
echo '</pre>';
if ($exit)
exit;
};
$parse = function($file, $show_debug = false) use ($debug) {
View Twitter User Object MySQL Schema.sql
CREATE TABLE `user` (
`twitter_id` int(10) unsigned NOT NULL,
`name` varchar(140) NOT NULL,
`screen_name` varchar(30) NOT NULL,
`location` varchar(180) default NULL,
`description` varchar(300) default NULL,
`profile_image_url` varchar(400) NOT NULL,
`url` varchar(400) default NULL,
`protected` varchar(5) default NULL,
`followers_count` int(10) unsigned NOT NULL,
@dre1080
dre1080 / csrf.php
Created Oct 26, 2011 — forked from dhrrgn/csrf.php
Simple, yet effective CSRF class for FuelPHP.
View csrf.php
<?php
/**
* Simple, yet effective CSRF class for FuelPHP.
*
* @author Dan Horrigan
* @license MIT License
* @copyright 2011 Dan Horrigan
*/
/**
@dre1080
dre1080 / util.go
Last active Sep 30, 2015
Print Echo registered routes
View util.go
package util
import (
"log"
"strings"
"github.com/labstack/echo"
)
// DebugPrintRoutes prints all registered routes of e.
@dre1080
dre1080 / async_iteration.js
Created Feb 20, 2012
Everything in node happens at the same time, which means, unless you're doing your processing inside your callbacks, you cannot guarantee asynchronous functions have completed yet.
View async_iteration.js
/**
* Source: http://stackoverflow.com/questions/6287908/nodejs-express-fs-iterating-files-into-array-or-object-failing
*/
var fs = require('fs'),
EventEmitter = require('events').EventEmitter,
filesEmitter = new EventEmitter(),
files = [];
// this event will be called when all files have been added to the files array
@dre1080
dre1080 / gist:2267982
Created Mar 31, 2012 — forked from jrochkind/gist:2161449
A Capistrano Rails Guide
View gist:2267982

A Capistrano Rails Guide

by Jonathan Rochkind, http://bibwild.wordpress.com

why cap?

Capistrano automates pushing out a new version of your application to a deployment location.

I've been writing and deploying Rails apps for a while, but I avoided using Capistrano until recently. I've got a pretty simple one-host deployment, and even though everyone said Capistrano was great, every time I tried to get started I just got snowed under not being able to figure out exactly what I wanted to do, and figured I wasn't having that much trouble doing it "manually".

@dre1080
dre1080 / haproxy.cnf
Created Apr 4, 2012 — forked from asabirov/haproxy.cnf
Nginx, Faye, Node.js on 80 port
View haproxy.cnf
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
maxconn 4096
nbproc 1
pidfile /var/run/haproxy.pid
user haproxy
group haproxy
@dre1080
dre1080 / haproxy.cnf
Created Apr 14, 2012 — forked from xeron/haproxy.cnf
haproxy.cnf
View haproxy.cnf
global
log 127.0.0.1 local0
log 127.0.0.1 local0 notice
maxconn 4096
nbproc 1
pidfile /var/run/haproxy.pid
user haproxy
group haproxy
You can’t perform that action at this time.