Skip to content

Instantly share code, notes, and snippets.

View craiglondon's full-sized avatar

Craig London craiglondon

View GitHub Profile
@craiglondon
craiglondon / .htaccess
Last active August 29, 2015 14:17 — forked from ludo237/.htaccess
# Apache configuration file
# httpd.apache.org/docs/2.2/mod/quickreference.html
# Note .htaccess files are an overhead, this logic should be in your Apache
# config if possible: httpd.apache.org/docs/2.2/howto/htaccess.html
# Techniques in here adapted from all over, including:
# Kroc Camen: camendesign.com/.htaccess
# perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/
# Sample .htaccess file of CMS MODx: modxcms.com
# This is the free sample of .htaccess from 6GO s.r.l.
# @author Claudio Ludovico Panetta (@Ludo237)
@elsassph
elsassph / sublimelinter-settings.json
Created January 5, 2012 13:22
My SublimeLinter's settings
[...]
/*
The minimum delay in seconds (fractional seconds are okay) before
a linter is run when the "sublimelinter" setting is true. This allows
you to have background linting active, but defer the actual linting
until you are idle. When this value is greater than the built in linting delay,
errors are erased when the file is modified, since the assumption is
you don't want to see errors while you type.
*/
@al-the-x
al-the-x / main.php
Created April 5, 2013 01:39
Coding Dojo at Orlando PHP 2013-04-04
<?php
/**
* Imagine a hallway (from the Matrix) with 50 doors on each side.
* Take a walk down the hallway and back up, opening every door.
* On a second pass, close all the even numbered doors.
* The third pass, each third door, close it if it's open and open if it's closed.
* Repeat.
* What is the state of the doors after 100 passes?
*/
@jasperf
jasperf / A Roots Sage Theme and Dev Setup.md
Last active May 12, 2016 16:38 — forked from corradomatt/Using Roots 8.0 Process.md
Setting up Roots 8.0 (Sage) on a a Mac with Local Yosemite OSX Server and AMP. This includes setting up the server part of things #roots #wordpress #osx
@artanisdesign
artanisdesign / .jshintrc
Last active July 8, 2016 20:04
Titanium JSHint setup
{
"bitwise": true,
"camelcase": true,
"eqeqeq": true,
"indent": 4,
"unused": true,
"onevar": true,
"undef": true,
"trailing": true,
"latedef": true,
@smac89
smac89 / .gitconfig
Last active June 21, 2017 15:59
Gitconfig settings to use p4merge on windows using Cygwin terminal
[merge]
tool = p4merge
[mergetool "p4merge"]
path = "C:/PROGRA~1/Perforce/p4merge.exe"
[mergetool]
keepBackup = false
trustExitcode = false
[diff]
tool = p4merge
@branch14
branch14 / isbn13to10.rb
Created June 9, 2013 19:18
script to convert isbn13 to isbn10
#!/usr/bin/env ruby
# returns isbn10 if the given string represents a isbn13
# returns the given string otherwise
def isbn13to10(line)
isbn13 = line.tr_s('- ', '')
return line unless isbn13.match(/\d{13}/)
isbn10 = isbn13[3,9]
checksum = 0
@mems
mems / README.md
Last active March 27, 2018 05:20
Fix AdressBook errors in OSX 10.11 (fixed in OSX 10.12)

For /var/log/system.log full of errors like these ones:

kernel[0]: Sandbox: com.apple.Addres(XXXXX) deny(1) network-outbound /private/var/run/mDNSResponder
com.apple.AddressBook.InternetAccountsBridge[XXXXX]: dnssd_clientstub ConnectToServer: connect()-> No of tries: 1
com.apple.AddressBook.InternetAccountsBridge[XXXXX]: dnssd_clientstub ConnectToServer: connect() failed path:/var/run/mDNSResponder Socket:4 Err:-1 Errno:1 Operation not permitted

How to fix it?

<?php
class EO_Shortcode_Grouped_Lists extends EventOrganiser_Shortcodes {
static function init() {
add_shortcode('eo_group_events_by_date', array(__CLASS__, 'handle_eventlist_shortcode'));
}
// Modified copy of orginal handle_eventlist_shortcode
static function handle_eventlist_shortcode($atts = array(), $content = null) {
@madsen
madsen / README.md
Last active June 18, 2019 06:33
Patch Asterisk to allow verifying Twilio's secure SIP trunking

Twilio Secure Trunking with Asterisk

Twilio now allows TLS & SRTP connections with their Elastic SIP Trunking. However, there are some issues with the way they've done it that prevent Asterisk from being able to verify their server's certificate.

First of all, their documentation tells you to download the Thawte Primary Root CA, when the certificate I saw was signed with the