Skip to content

Instantly share code, notes, and snippets.

View tonykwon's full-sized avatar
💭
😃

Tony Kwon tonykwon

💭
😃
View GitHub Profile
@tonykwon
tonykwon / gist:a3fc8ffc2a1fe537789a
Created September 25, 2014 17:01
Bootstrap WordPress :)
<?php
define('WP_ROOT', $_SERVER['DOCUMENT_ROOT']); // you can specify where the WordPress is
define('WP_USE_THEMES', false);
/* bootstrap WordPress */
require_once WP_ROOT . '/' . 'wp-load.php';
/* bootstrap is done :) */
@tonykwon
tonykwon / gist:4ad4595f32510d6739eb
Created October 27, 2014 17:13
Targetting IE 10+ w/out conditional comments
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
/* IE10+ specific styles go here */
}
@tonykwon
tonykwon / gist:405251858843e9cfefb2
Created November 3, 2014 20:24
Customizing admin menus which are created by Wordpress MVC plugin
bootstrap.php
MvcConfiguration::append(array(
'AdminPages' => array(
'flakes' => array(
'add',
'other1',
),
)
));
@tonykwon
tonykwon / gist:7e6422ea84669046706c
Created May 5, 2015 03:37
Virtual Box - Arch Linux
pacman -S virtualbox-guest-utils
pacman -S virtualbox-guest-modules
pacman -S virtualbox-guest-modules-lts
pacman -S virtualbox-guest-dkms
/etc/modules-load.d/virtualbox.conf
vboxguest
vboxsf
vboxvideo
Verifying I am +tonykwon on my passcard. https://onename.com/tonykwon
<?php
/*
* router.php
* from https://docs.docker.com/compose/wordpress/
*
*/
$root = $_SERVER['DOCUMENT_ROOT'];
chdir($root);
$path = '/'.ltrim(parse_url($_SERVER['REQUEST_URI'])['path'],'/');
@tonykwon
tonykwon / Page Extraction.txt
Last active July 17, 2017 02:35
Extract PDF Pages and save them as images
# convert some.pdf[15-19] some.png
# convert some.pdf[15-19] some.jpg
# convert some.pdf[15-19] some.gif
# convert -density 200 some.pdf some.png
# convert some.pdf -resize 50% some.png
$imagick = new Imagick();
$ docker stop $(docker ps -a -q)
$ docker rm $(docker ps -a -q)
# if it is sluggish and has issues fetching stuff via network
#
$ docker-machine restart default # Restart the environment
$ eval $(docker-machine env default) # Refresh your environment settings
# get the container ID of by container Name
@tonykwon
tonykwon / docker-machine-use-nfs.sh
Created October 16, 2015 22:39 — forked from olalonde/docker-machine-use-nfs.sh
Use NFS instead of vboxsf in Docker Machine
#!/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
#
@tonykwon
tonykwon / Steps
Last active August 23, 2019 21:34
tinydns and dnscache setup on OS X
0. create users then hide dnsrun and dnslog users from the login window
$ sh create-user-group.sh
$ sudo defaults write /Library/Preferences/com.apple.loginwindow HiddenUsersList -array-add dnsrun dnslog
1. Install daemontools -> http://cr.yp.to/daemontools.html
$ mkdir /package
$ cd /package
$ curl http://cr.yp.to/daemontools/daemontools-0.76.tar.gz -o daemontools-0.76.tar.gz
$ tar -xvzf daemontools-0.76.tar.gz