Skip to content

Instantly share code, notes, and snippets.

View craighooghiem's full-sized avatar

Craig Hooghiem craighooghiem

View GitHub Profile
@craighooghiem
craighooghiem / eloquent.php
Last active November 27, 2021 09:27 — forked from clauddiu/eloquent.php
Using Eloquent outside of Laravel. This specific example was used in a Silex installation.
<?php
require 'vendor/autoload.php';
$settings = array(
'driver' => 'mysql',
'host' => '127.0.0.1',
'database' => 'database',
'username' => 'root',
'password' => 'root',
@craighooghiem
craighooghiem / gist:10229610f58879a399da
Created September 29, 2014 23:53
Fix homebrew dylb link issues after upgrading OS X - relinks all libs in homebrew
brew list -1 | while read line; do brew unlink $line; brew link $line; done
@craighooghiem
craighooghiem / .htaccess.md
Last active March 20, 2016 12:09 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
@craighooghiem
craighooghiem / customtype.php
Last active October 1, 2016 14:36 — forked from davatron5000/videos.php
WordPress Custom Post Type Plugin Template
<?php
/*
Plugin Name: CustomType
Plugin URI:
Author: Craig Hooghiem
Author URI: http://www.craighooghiem.com
Description: A custom post type that adds CustomType and custom taxonomies.
Version: 1.0
*/
@craighooghiem
craighooghiem / kill-slow-queries.sh
Created November 22, 2017 19:35 — forked from tessro/kill-slow-queries.sh
A script for killing slow MySQL queries, suited for a cron job
#!/bin/sh
# Credentials for a MySQL user with PROCESS, SUPER permissions
USERNAME=
PASSWORD=
# MySQL Server location
HOST=127.0.0.1
PORT=3306
@craighooghiem
craighooghiem / kill-slow-queries.sh
Created November 22, 2017 19:35 — forked from tessro/kill-slow-queries.sh
A script for killing slow MySQL queries, suited for a cron job
#!/bin/sh
# Credentials for a MySQL user with PROCESS, SUPER permissions
USERNAME=
PASSWORD=
# MySQL Server location
HOST=127.0.0.1
PORT=3306
@craighooghiem
craighooghiem / phantomjs-linkedin.js
Last active March 12, 2018 18:44 — forked from pasiaj/phantomjs-linkedin.js
A phantomjs script to:a) Login to Linkedin.com b) Scrape all your contacts c) Visit all the contacts d) Map potential contacts
var auth = {
user: "USERNAME",
pass: "PASSWORD"
};
function ParallelRunner (list, func, runners) {
function createSlots(runners) {
var slots = [];
for (var i = 0; i < runners; i++) {
slots.push( objReturner() );