Skip to content

Instantly share code, notes, and snippets.

# Setting up dnsmasq for Local Web Development Testing on any Device
Please note, these instructions are for OS X Lion.
First, you need to get the IP address of your machine on your local network. In OS X, the easiest place to find this is in System Preferences > Network. If you're using DHCP on your local network, you will want to make sure your computer requests the same IP address when it renews it's IP address lease. I recommend configuring the DCHP Reservation settings on your router to accomplish this. Otherwise, you can specify a manual address in your network settings:
1. Go to *System Preferences > Network*
1. Click *Advanced...*

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
#!/bin/bash
while :
do
clear
git --no-pager log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ci) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative --all
sleep 1
done
/*
* From css-tricks.com
* http://css-tricks.com/snippets/css/media-queries-for-standard-devices/
*/
/* Smartphones (portrait and landscape) ----------- */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px) {
/* Styles */
@machouinard
machouinard / PEX Basic
Created December 28, 2013 18:49
PermissionsEX Basic
groups:
Default
default: true
build: true
prefix: '&7[Member]&f'
permissions
- essentials.help
- modifyworld.chat
- modifyworld.*
- essentials.home
[
{ "keys": ["super+shift+t"], "command": "delete_trailing_spaces" },
{"keys": ["super+shift+r"], "command": "reindent" , "args": {"single_line": false}},
{"keys": ["ctrl+alt+b"], "command": "xdebug_breakpoint"},
{"keys": ["ctrl+alt+f8"], "command": "xdebug_conditional_breakpoint"},
{"keys": ["ctrl+alt+r"], "command": "xdebug_continue", "args": {"command": "run"}},
{"keys": ["ctrl+alt+o"], "command": "xdebug_continue", "args": {"command": "step_over"}},
{"keys": ["ctrl+alt+i"], "command": "xdebug_continue", "args": {"command": "step_into"}},
{"keys": ["ctrl+alt+u"], "command": "xdebug_continue", "args": {"command": "step_out"}},
{"keys": ["ctrl+shift+x"], "command": "xdebug_session_start"},
def screenshotFilter(poi):
'''This looks for signs that have their first line in the 'Image:<id>' format, where <id> is an
id from an Imgur.com image.'''
if poi['id'] == 'Sign':
if poi['Text1'].startswith('Image:'):
poi['icon'] = "painting_icon.png"
image_html = "<style>.infoWindow img[src='{icon}'] {{display: none}}</style><a href='http://imgur.com/{id}'><img src='http://imgur.com/{id}s.jpg' /></a>".format(icon=poi['icon'], id=poi['Text1'][6:])
return "\n".join([image_html, poi['Text2'], poi['Text3'], poi['Text4']])
def playerFilter(poi):
<?php
/**
* Plugin Name: Force Strict OFF
* Description: Forces Strict errors off
* Author: John P. Bloch
* Version: 0.1
* License: GPLv2
*/
if ( WP_DEBUG ) {
<?php
function tott_enable_menu_export() {
global $wp_post_types;
$wp_post_types['nav_menu_item']->_builtin = false;
}
add_action( 'load-export.php', 'tott_enable_menu_export' );