Skip to content

Instantly share code, notes, and snippets.

View marfarma's full-sized avatar

Pauli Price marfarma

View GitHub Profile
@franz-josef-kaiser
franz-josef-kaiser / current_admin_info.php
Created September 13, 2012 01:25
Collect & display data from current admin screens contextual hooks and from which hook on some globals are available.
MOVED TO A REPO NOW: https://github.com/franz-josef-kaiser/current-admin-info
@cowboy
cowboy / stringify.js
Created September 19, 2012 13:45
JavaScript: like JSON.stringify but handles functions, good for creating arbitrary .js objects?
var stringify = function(obj, prop) {
var placeholder = '____PLACEHOLDER____';
var fns = [];
var json = JSON.stringify(obj, function(key, value) {
if (typeof value === 'function') {
fns.push(value);
return placeholder;
}
return value;
}, 2);
@kasparsd
kasparsd / wordpress-plugin-svn-to-git.md
Last active June 13, 2024 06:57
Using Git with Subversion Mirroring for WordPress Plugin Development
@Rarst
Rarst / backtrace-error-handler.php
Created October 4, 2012 19:31
Error handler with WordPress backtrace in message.
<?php
set_error_handler( 'backtrace_error_handler', error_reporting() );
function backtrace_error_handler( $errno, $errstr, $errfile, $errline, $errcontext ) {
// handle @
if( 0 === error_reporting() )
return false;
@mrosset
mrosset / build
Last active December 10, 2015 02:38
#!/bin/bash
# This is a simple build script and will be executed on your CI system if
# available. Otherwise it will execute while your application is stopped
# before the deploy step. This script gets executed directly, so it
# could be python, php, ruby, etc.
tarball="https://go.googlecode.com/files/go1.0.3.linux-amd64.tar.gz"
# Set GOROOT since we dont use GOROOT_FINAL
export GOROOT="$OPENSHIFT_HOMEDIR/app-root/data/go"
@elimisteve
elimisteve / build
Last active December 10, 2015 11:29 — forked from mrosset/build
`build`, `start`, and `stop` scripts for getting Go web apps to run on OpenShift. Put these files in the `.openshift/action_hooks/` directory of your app.
#!/bin/bash
# This is a simple build script and will be executed on your CI system if
# available. Otherwise it will execute while your application is stopped
# before the deploy step. This script gets executed directly, so it
# could be python, php, ruby, etc.
tarball="https://go.googlecode.com/files/go1.0.3.linux-amd64.tar.gz"
# Set GOROOT since we don't use GOROOT_FINAL
mkdir -p $OPENSHIFT_HOMEDIR/app-root/data/go
@matthewriley
matthewriley / gist:4694850
Last active October 24, 2018 01:48
Install Git 1.8.1.2 from source on CentOS 6.3

Install Git 1.8.1.2 from source on CentOS 6.3

These are the Terminal commands I recently used (Feb 2013) to install Git 1.8.1.2 from source on CentOS 6.3. I ran this in a VirtualBox VM after a fresh install from the ISO.

You mileage will vary as the yum packages are updated over time. The yum install line below should include all the dependencies, at least it did for me. Eventually yum install git will include 1.8.x but until then I hope this helps.

cd ~/Downloads
su
yum -y install zlib-devel openssl-devel cpio expat-devel gettext-devel curl-devel perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker
@jamesmbeams
jamesmbeams / gist:5155230
Created March 13, 2013 19:20
To allow Cordova (iOS) to connect to HTTPS with a self signed certificate, paste this at the bottom of AppDelegate.m NOTE: Only for testing, remember to remove it before submitting to the App Store, as I hear it could cause the app to be rejected.
@implementation NSURLRequest (ServiceClient)
+ (BOOL) allowsAnyHTTPSCertificateForHost:(NSString *) host
{
return YES;
}
@end
@twilson63
twilson63 / app.js
Created May 4, 2013 01:40
ideablog app.js
var config = require('./config');
var nano = require('nano')(config.db);
var express = require('express');
var async = require("async");
var app = express();
var modelDoc = {
language: "javascript",
views: {
all: {
@darktim
darktim / backup-github.sh
Last active November 8, 2021 09:14 — forked from rodw/backup-github.sh
If you have more than 30 Repositories, the original script will not download all. The github api limits the entries to 30 per page but you can raise that up to 100. I have added a small loop which sets the limit to 90 and cycles through all pages until the listing on a page is empty...
#!/bin/bash
# A simple script to backup an organization's GitHub repositories.
GHBU_BACKUP_DIR=${GHBU_BACKUP_DIR-"github-backups"} # where to place the backup files
GHBU_ORG=${GHBU_ORG-"<CHANGE-ME>"} # the GitHub organization whose repos will be backed up
GHBU_UNAME=${GHBU_UNAME-"<CHANGE-ME>"} # the username of a GitHub account (to use with the GitHub API)
GHBU_PASSWD=${GHBU_PASSWD-"<CHANGE-ME>"} # the password for that account
GHBU_GITHOST=${GHBU_GITHOST-"<CHANGE-ME>.github.com"} # the GitHub hostname (see notes)
GHBU_PRUNE_OLD=${GHBU_PRUNE_OLD-true} # when `true`, old backups will be deleted
GHBU_PRUNE_AFTER_N_DAYS=${GHBU_PRUNE_AFTER_N_DAYS-3} # the min age (in days) of backup files to delete