Skip to content

Instantly share code, notes, and snippets.

View davidhemphill's full-sized avatar
💀
WIP

Hemp davidhemphill

💀
WIP
View GitHub Profile
@damien
damien / wp-config-extras.php
Created August 24, 2009 01:26
Some helpful settings for WordPress development, to be appended to wp-config.php
<?php
/** Development settings.
*
* These are some customs settings that allow us to import arbitrary WordPress
* databases and run them within our development environment without any additional
* configuration. Append this to your regular wp-config.php file and customize as needed.
*
* @link http://gist.github.com/gists/173574
*/
@soffes
soffes / install.markdown
Last active July 3, 2024 03:04
New computer setup

New Machine

Updated this for the first time in awhile in late 2020.

System Preferences

  • Enable iCloud
  • Disable iCloud mail
  • Display to medium
  • Turn up trackpad speed
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Border Image Test</title>
<style type="text/css">
#slider {
/*This shows how to use border-image to mimic the behavior
of stretchableImageWithLeftCapWidth:topCapHeight: in CSS.
This example has a border-left and border-right width of 15px.
@nickfloyd
nickfloyd / recipe: deleting branches
Created December 13, 2010 17:56
To delete local and remote branches
-delete the remote
>> git push [remote] :[branch]
-delete the local
>> git branch -d [branch]
ex.
git push origin :dev1
git branch -d dev1
@dawsontoth
dawsontoth / tweetView.js
Created February 10, 2011 04:07
Make tweets and links clickable in Titanium Mobile! Here I make a tweet look just like it does on Twitter, and interact the same too.
/**
* Define our parser class. It takes in some text, and then you can call "linkifyURLs", or one of the other methods,
* and then call "getHTML" to get the fully parsed text back as HTML!
* @param text that you want parsed
*/
function Parser(text) {
var html = text;
var urlRegex = /((ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?)/gi;
@ChrisMBarr
ChrisMBarr / includeCSS.js
Last active September 26, 2015 12:47
Add a CSS stylesheet to the head of a document
$.extend({
includeCss: function(cssLink, isPrint, callbackFn) {
var $head = $("head");
//Make sure it's a valid string and not already included in the head
if (typeof cssLink === "string" && cssLink.length > 1 && $head.find("link[href='" + cssLink + "']").length <= 0) {
//Create a new link element
var $newLinkTag;
var mediaType = (isPrint) ? 'print' : 'all';
//Needed for IE8 and lower
@j-mcnally
j-mcnally / pg.php
Created August 18, 2011 01:13
CodeIgniter Permalink Routing
<?php
//would be controllers/pg.php
class pg extends Controller {
var $pgItem;
var $parentPage;
function pg() {
//do some constructor related stuff here
}
function permalink($segments) {
@jimbojsb
jimbojsb / gist:1630790
Created January 18, 2012 03:52
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

@cmer
cmer / cjax.js.coffee
Created March 9, 2012 20:54
CJAX - History.js-PJAX hybrid that doesn't suck in IE
# This is a work in progress. I use it in production and it works very well, but use at your own risk!
@initCJAX = () ->
History = @History
$ = @jQuery
document = @document
return false unless @History.enabled
$ ->
contentSelector = ".main"
@paulnicholson
paulnicholson / powssl
Last active November 24, 2021 16:40
ssl with pow using stud

Instructions

  • Install stud $ brew install https://raw.github.com/paulnicholson/homebrew/master/Library/Formula/stud.rb
  • Download and install the powssl script $ curl https://gist.githubusercontent.com/paulnicholson/2050941/raw/7e4d2178e3733bed18fdfe737277c3cb72241d39/powssl > ~/bin/powssl $ chmod +x ~/bin/powssl
  • Run powssl to create development certificate and configure stud.
  • $ powssl