Skip to content

Instantly share code, notes, and snippets.

View paulschreiber's full-sized avatar

Paul Schreiber paulschreiber

View GitHub Profile
@kfatehi
kfatehi / _list-github-pull-requests.md
Last active April 29, 2024 00:26
list pull requests across entire organization
@grahamgilbert
grahamgilbert / base64_plist.py
Created September 5, 2016 11:03
Writing a base64 encoded string into a plist
#!/usr/bin/python
import base64
import plistlib
import errno
import os
def mkdir_p(path):
try:
os.makedirs(path)
@MikeNGarrett
MikeNGarrett / wp-config.php
Last active April 26, 2024 10:15
All those damned wp-config constants you can never remember.
<?php
// PHP memory limit for this site
define( 'WP_MEMORY_LIMIT', '128M' );
define( 'WP_MAX_MEMORY_LIMIT', '256M' ); // Increase admin-side memory limit.
// Database
define( 'WP_ALLOW_REPAIR', true ); // Allow WordPress to automatically repair your database.
define( 'DO_NOT_UPGRADE_GLOBAL_TABLES', true ); // Don't make database upgrades on global tables (like users)
// Explicitely setting url
@geoff-nixon
geoff-nixon / osx-software-update-urls.txt
Created September 23, 2015 08:04 — forked from stefanschmidt/osx-software-update-urls.txt
URLs of the index files used by the software update client on OS X
10.3 (Panther):
https://swscan.apple.com/scanningpoints/scanningpointX.xml
10.4 (Tiger):
https://swscan.apple.com/content/catalogs/index.sucatalog
https://swscan.apple.com/content/catalogs/index-1.sucatalog
10.5 (Leopard):
https://swscan.apple.com/content/catalogs/others/index-leopard.merged-1.sucatalog
#!/usr/bin/env ruby
require 'watir-webdriver'
require 'webrick/httpproxy'
# USAGE: ./proxied_browser.rb server (port) [json]
# ./proxied_browser.rb browser (port)
class ProxiedBrowser < Watir::Browser
def initialize(port)
proxy = ['localhost',port].join(?:)
@pixeltrix
pixeltrix / time_vs_datatime.md
Last active February 18, 2024 19:20
When should you use DateTime and when should you use Time?

When should you use DateTime and when should you use Time?

It's a common misconception that [William Shakespeare][1] and [Miguel de Cervantes][2] died on the same day in history - so much so that UNESCO named April 23 as [World Book Day because of this fact][3]. However because England hadn't yet adopted [Gregorian Calendar Reform][4] (and wouldn't until [1752][5]) their deaths are actually 10 days apart. Since Ruby's Time class implements a [proleptic Gregorian calendar][6] and has no concept of calendar reform then there's no way to express this. This is where DateTime steps in:

>> shakespeare = DateTime.iso8601('1616-04-23', Date::ENGLAND)
=> Tue, 23 Apr 1616 00:00:00 +0000
>> cervantes = DateTime.iso8601('1616-04-23', Date::ITALY)
=> Sat, 23 Apr 1616 00:00:00 +0000
@drewreece
drewreece / AHT-my-disk.sh
Last active May 15, 2023 09:22
Install Apple Hardware Test to a volume and bless the AHT
#!/bin/sh
#
# AHT My Disk
#
# Copy Apple Hardware Test to a volume and bless the hardware test to be bootable
#
# Useful list of AHT & models from upekkha - https://github.com/upekkha/AppleHardwareTest thx u :)
# find your model details & get the AHT disk image
## sysctl hw.model | awk '{ print $2 }'
## ioreg -l | grep board-id | awk -F\" '{ print $4 }'
@jvenator
jvenator / gist:9672772a631c117da151
Last active April 28, 2024 01:09
PDFtk Server Install Workaround for Mac OS X

Installing PDFtk Server edittion on your Mac

This workaround install is necessary because PDFtk was pulled from homebrew-cask due to issues with it aggressively overwriting file permissions that could impact other installed libraries. See this homebrew-cask issue.
The following steps worked on Mac OS X 10.10.1 with a standard brew installation for the PDFtk Mac OS X server libary version 2.02.
All Terminal commands separated by a full line space. Some commands wrap into multiple lines.

Download and extract the Mac OS X server install pacakge

@dtbaker
dtbaker / gist:da02576c021646cd97d7
Created January 7, 2015 01:23
boutique_line shortcode
<?php
/**
* Class dtbaker_Shortcode_Line
* handles the creation of [boutique_line] shortcode
* adds a button in MCE editor allowing easy creation of shortcode
* creates a wordpress view representing this shortcode in the editor
* edit/delete button on wp view as well makes for easy shortcode managements.
* Author: dtbaker@gmail.com
* Copyright 2014
@matthewmueller
matthewmueller / osx-for-hackers.sh
Last active April 21, 2024 03:30
OSX for Hackers (Mavericks/Yosemite)
# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront