Skip to content

Instantly share code, notes, and snippets.

@badsyntax
badsyntax / build.sh
Created January 11, 2011 20:56
An example PHP & BASH Post-Receive github web hook to package projects
#! /usr/bin/env bash
#clone the repo
git clone -q "${1}" "clones/${2}"
cd "clones/${2}"
#update the submodules (how do we handle errors here?)
git submodule --quiet update --init --recursive
@brtriver
brtriver / index.php
Created March 18, 2012 08:48
silex with cookie
<?php
require __DIR__ .'/silex.phar';
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Cookie;
$app = new Silex\Application();
$app['debug'] = true;
#!/bin/bash
BACKUP_ROOT="$HOME/redmine_backup"
REDMINE_ROOT="/var/www/redmine"
BACKUP_FILENAME='backup_redmine_'`date +%Y%m%d`'.tar.bz2'
DB_DUMP_FILENAME='db_redmine_'`date +%Y%m%d`'.sqlc'
if [ ! -d "$BACKUP_ROOT" ]; then
mkdir $BACKUP_ROOT
fi
@willwade
willwade / KeyCodes.csv
Created April 7, 2013 13:25
Character code translation table for Mac/PC/Linux From: http://web.archive.org/web/20100501161453/http://www.classicteck.com/rbarticles/mackeyboard.php NB: Some of these are wrong. Follow the spreadsheet for updates as and when I find them at https://github.com/willwade/MacroServerMac/blob/master/KeyCodes.csv
Key Mac Windows Linux Notes
rbKeyUp 126 26 103
rbKeyDown 125 28 108
rbKeyLeft 123 25 105
rbKeyRight 124 27 106
rbKeyBackspace 117 8 14
rbKeyEnter 76 * 28
rbKeyHome 115 36 102
rbKeyEnd 119 35 107
rbKeyPageDown 121 34 109
@6174
6174 / Random-string
Created July 23, 2013 13:36
Generate a random string in JavaScript In a short and fast way!
//http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript
Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
@bradmontgomery
bradmontgomery / install-comodo-ssl-cert-for-nginx.rst
Last active June 10, 2024 15:37
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@yorkxin
yorkxin / rfc6749.md
Last active April 6, 2022 11:54
RFC 6749 in Markdown - Edited from http://tools.ietf.org/rfc/rfc6749.txt
Internet Engineering Task Force (IETF)                     D. Hardt, Ed.
Request for Comments: 6749                                     Microsoft
Obsoletes: 5849                                             October 2012
Category: Standards Track
ISSN: 2070-1721

The OAuth 2.0 Authorization Framework

Abstract

@m4ttbrock
m4ttbrock / nginx-nodejs-cors
Last active November 9, 2020 18:06
Nginx Nodejs CORS to subdomain
server {
listen 80;
server_name subdomain.example.com;
access_log /var/log/nginx/example.access.log;
location / {
if ($http_origin ~* (https?://.*\.example\.com(:[0-9]+)?)) {
set $cors "true";
@stephenturner
stephenturner / install-gcc48-linuxbrew-centos6.md
Last active March 6, 2022 02:49
Installing gcc 4.8 and Linuxbrew on CentOS 6

Installing gcc 4.8 and Linuxbrew on CentOS 6

The GCC distributed with CentOS 6 is 4.4.7, which is pretty outdated. I'd like to use gcc 4.8+. Also, when trying to install Linuxbrew you run into a dependency loop where Homebrew's gcc depends on zlib, which depends on gcc. Here's how I solved the problem.

Note: Requires sudo privileges.

Resources:

function vacation() {
/*
* trigger when someone submits the form
* 1. add an event to calendar
* 2. send a message to slack channel
*/
// the sheet for form data is called "data"
var sheetName = 'data';
var calendarID = '';