Skip to content

Instantly share code, notes, and snippets.

View tonykwon's full-sized avatar
💭
😃

Tony Kwon tonykwon

💭
😃
View GitHub Profile
@kovshenin
kovshenin / options.php
Created April 23, 2012 12:12
Reusable Settings API fields
<?php
/**
* Text Field
*
* A simple text field callback to use with the Settings API. Don't forget to pass in
* the arguments array. Here's an example call to add_settings_field() :
*
* add_settings_field( 'my_option', __( 'My Option' ), 'foo_field_text', 'theme_options', 'general', array(
* 'name' => 'my_theme_options[my_option]',
* 'value' => $options['my_option'], // assuming $options is declared
@mralexgray
mralexgray / strings `which diskutil` | grep Usage
Created June 23, 2012 19:07
OS X Lion diskutil commands (documented and hidden).sh
Usage: diskutil coreStorage list
Usage: diskutil coreStorage info[rmation] [-plist]
Usage: diskutil coreStorage convert
Usage: diskutil coreStorage revert
Usage: diskutil coreStorage create lvgName
Usage: diskutil coreStorage delete lvgUUID
Usage: diskutil coreStorage addDisk lvgUUID NewMemberDeviceName
Usage: diskutil coreStorage removeDisk pvUUID
Usage: diskutil coreStorage deleteVolume lvUUID
Usage: diskutil coreStorage resizeVolume lvUUID size
@rodw
rodw / backup-github.sh
Last active June 4, 2024 16:06
A simple script to backup an organization's GitHub repositories, wikis and issues.
#!/bin/bash
# A simple script to backup an organization's GitHub repositories.
#-------------------------------------------------------------------------------
# NOTES:
#-------------------------------------------------------------------------------
# * Under the heading "CONFIG" below you'll find a number of configuration
# parameters that must be personalized for your GitHub account and org.
# Replace the `<CHANGE-ME>` strings with the value described in the comments
# (or overwrite those values at run-time by providing environment variables).
@shrop
shrop / brewStack.md
Last active October 11, 2023 20:18
brewStack Docs
@tamagokun
tamagokun / config.php
Created June 12, 2013 15:38
Rack'em app for serving Wordpress applications via php-cgi. No longer needing to configure nginx/apache locally ftw.
<?php
require 'vendor/autoload.php';
class Cgi
{
public $app, $public_folder;
public function __construct($app, $public_folder)
{
@nery
nery / postalregex.js
Created February 20, 2014 17:17
Canadian postal code validation
/*
Slightly strict regex check for validly formatted Canadian postal code
http://jsfiddle.net/7mBFf/
*/
var postal = new RegExp(/^\s*[a-ceghj-npr-tvxy]\d[a-ceghj-npr-tv-z](\s)?\d[a-ceghj-npr-tv-z]\d\s*$/i);
console.log(postal.test('m6k1s4')); // returns true
console.log(postal.test('M6K1S4')); // returns true
console.log(postal.test('90210')); // returns false
@gmazzap
gmazzap / www-post-thumb.php
Last active January 28, 2023 03:57
WordPress plugin that allow to use an external image url as featured image.
<?php namespace GM\WWWPostThumbnail;
/**
* Plugin Name: WWW Post Thumbnail
* Description: Allow to use an external image url as featured image.
* Plugin URI: https://gist.github.com/Giuseppe-Mazzapica/928bc22e5f49a654cf7c
* Author: Giuseppe Mazzapica
* Author URI: https://github.com/Giuseppe-Mazzapica
* License: MIT
* Version: 0.1.0
*
@olalonde
olalonde / boot2docker-use-nfs.sh
Last active December 4, 2023 12:07
Script to mount /Users with nfs instead of vboxsf in boot2docker
#!/bin/bash
#
# This script will mount /Users in the boot2docker VM using NFS (instead of the
# default vboxsf). It's probably not a good idea to run it while there are
# Docker containers running in boot2docker.
#
# Usage: sudo ./boot2docker-use-nfs.sh
#
@baetheus
baetheus / .README.md
Last active December 2, 2017 00:23
Unbound on OS X Yosemite

Unbound on OS X Yosemite

Introduction

These are instructions for properly setting up unbound as a local caching dns recursor on OS X Yosemite. There's probably some additional stuff that can be done to secure unbound, but I'm still getting into the OS X launchd stuff. Also,

Prerequisites

Bootstrap pkgsrc from joyent as soon as you can. I used to use homebrew, but I'm not a huge fan of ruby. You can of course avoid using the binary package set from joyent if you like, and instead install pkgsrc manually and build unbound yourself. Pkgsrc is also available on a wide array of platforms, so it's nice to have consistency across os x, linux, and illumos.

Install and Configure Unbound