Skip to content

Instantly share code, notes, and snippets.

View silverbux's full-sized avatar

Alex Quiambao silverbux

  • Philippines
View GitHub Profile
<?php
return array(
/*
|--------------------------------------------------------------------------
| PDO Fetch Style
|--------------------------------------------------------------------------
|
| By default, database results will be returned as instances of the PHP
<!doctype html>
<html ng-app="app">
<head>
<meta charset="utf-8">
<title>AngularJS App</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
@silverbux
silverbux / jscsrc.md
Last active August 29, 2015 14:26
jscsrc file
{
    "requireCurlyBraces": [
        "if",
        "else",
        "for",
        "while",
        "do",
        "try",
        "catch"
{
  // Simply using `node` without specifying a path sometimes doesn't work :(
  // https://github.com/victorporof/Sublime-HTMLPrettify#oh-noez-command-not-found
  // http://nodejs.org/#download
  "node_path": {
    "windows": "node.exe",
    "linux": "/usr/bin/nodejs",
    "osx": "/opt/boxen/nodenv/shims/node"
 },
@silverbux
silverbux / process.nextTick.js
Last active September 15, 2015 02:05 — forked from WebReflection/process.nextTick.js
process.nextTick(callback) for browsers too
!function (window) {"use strict";
// by WebReflection - WTFPL License
var
prefixes = "r webkitR mozR msR oR".split(" "),
process = "process",
nextTick = "nextTick",
i = 0,
p = window[process] || (window[process] = {})
;
while (!p[nextTick] && i < prefixes.length)
web:
build: ./node
volumes:
- "app:/src/app"
expose:
- "3000"
links:
- "db:redis"
- "mongodb"
command: nodemon -L app/server/server.js
web:
build: ./coder/
expose:
- "5000"
links:
- "db:redis"
- "mongodb"
command: nodemon -L app/server/server.js
nginx:
@silverbux
silverbux / dokku-setup.sh
Last active November 27, 2015 01:53
Setup dokku on digitalocean + install mongodb plugin + fix mongodb remote connection issues + fix digital ocean memory issues
#!/bin/bash
dokku plugin:install https://github.com/dokku/dokku-mongo.git mongo &&
docker pull mongo:2.6.11 &&
apt-get install -y mongodb-clients &&
echo 'export MONGO_CONFIG_OPTIONS=" --auth "' >> ~/.bashrc &&
echo 'export MONGO_IMAGE_VERSION="2.6.11"' >> ~/.bashrc &&
sudo swapon -s &&
sudo fallocate -l 4G /swapfile &&
ls -lh /swapfile &&
@silverbux
silverbux / pr.md
Created December 9, 2015 06:20 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: