Skip to content

Instantly share code, notes, and snippets.

View jpalala's full-sized avatar
🔭
Lets build something useful

Joe Palala jpalala

🔭
Lets build something useful
View GitHub Profile
@jpalala
jpalala / gist:bf459d8d2ddbf05a8af87e5961d655e2
Created August 20, 2017 03:56 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
#
# REQUIRES:
# - server (the forge server instance)
# - site_name (the name of the site folder)
# - sudo_password (random password for sudo)
# - db_password (random password for database user)
# - event_id (the provisioning event name)
# - callback (the callback URL)
#

Three things to remember while configuring a couchapp to run as a web facing application. Below, I document the steps I took to deploy the example pages app from couchapp.org.

  1. set the vhost in /etc/couchdb/local.ini.

    [vhosts] home.btbytes.com = /pages/_design/pages/_rewrite

  2. add vhosts entry to couchdb by visiting configuration page in futon app and adding a new section:

@jpalala
jpalala / index.js
Created July 12, 2017 03:31 — forked from bromanko/index.js
Express Middleware for Bunyan logging
var bunyan = require('bunyan');
module.exports.logger = function logger(log) {
if (typeof (log) !== 'object')
throw new TypeError('log (Object) required');
this.log = log;
var self = this;
return function logger(req, res, next) {
Simple contract or interface, call as you wish:
interface UnitOfWork
{
public function begin();
public function commit();
public function rollback();
}
@jpalala
jpalala / http.js
Created April 23, 2017 07:32 — forked from FND/http.js
JavaScript HTTP requests (fetch, jQuery, XHR)
/* eslint-env browser */
import jQuery from "jquery"
export function ftch(method, uri, headers, payload) {
let options = { method, headers, credentials: "include" }
if(payload) {
options.body = payload
}
return fetch(uri, options)
}
@jpalala
jpalala / curl.md
Created April 22, 2017 14:22 — forked from btoone/curl.md
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API.

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
@jpalala
jpalala / phpmyadmin.conf
Created April 8, 2017 17:47 — forked from samundra/phpmyadmin.conf
phpmyadmin.conf
# You may add here your
# server {
# ...
# }
# statements for each of your virtual hosts to this file
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
@jpalala
jpalala / ducks.sh
Created March 28, 2017 07:42 — forked from thebouv/ducks.sh
ducks: linux command for the 10 largest files in current directory
du -cks * | sort -rn | head -11
# Usually set this up in my bash profile as an alias:
# alias ducks='du -cks * | sort -rn | head -11'
# Because it is fun to type ducks on the command line. :)
@jpalala
jpalala / .gitconfig
Created March 24, 2017 09:17 — forked from robmiller/.gitconfig
Some useful Git aliases that I use every day
#
# Working with branches
#
# Get the current branch name (not so useful in itself, but used in
# other aliases)
branch-name = "!git rev-parse --abbrev-ref HEAD"
# Push the current branch to the remote "origin", and set it to track
# the upstream branch
publish = "!git push -u origin $(git branch-name)"