Skip to content

Instantly share code, notes, and snippets.

View CraigChilds94's full-sized avatar
🏠
Working from home

Craig Childs CraigChilds94

🏠
Working from home
View GitHub Profile
@Radiergummi
Radiergummi / TimeSpan.php
Last active July 12, 2018 16:49
TimeSpan class - a flexible PHP class to handle time calculations
<?php
/**
* TimeSpan class
* ==============
*
* Provides a convenience class to handle time amounts and time spans: Ever wondered how to easily figure out how many
* hours there are between 09:15:31 and 18:55:01? This class is for you. Going with the example, it's as easy as:
*
* `echo (new TimeSpan('18:55:01'))->sub('09:15:31')->format('h:m'); // '09:39'`
@dylanmckay
dylanmckay / facebook-contact-info-summary.rb
Last active March 12, 2024 22:46
A Ruby script for collecting phone record statistics from a Facebook user data dump
#! /usr/bin/env ruby
# NOTE: Requires Ruby 2.1 or greater.
# This script can be used to parse and dump the information from
# the 'html/contact_info.htm' file in a Facebook user data ZIP download.
#
# It prints all cell phone call + SMS message + MMS records, plus a summary of each.
#
# It also dumps all of the records into CSV files inside a 'CSV' folder, that is created
@Radiergummi
Radiergummi / README.md
Last active November 24, 2017 11:22
Phoenix

Phoenix

A lightweight and modular framework to document code projects

Reasoning

Born out of frustration while working on a Vue.js project, I decided to write something on my own. The amount of work to generate documentation for a simple project involving Vue.js components seemed tedious to me: While there are certain packages that parse single file components, it seemed near

@roylee0704
roylee0704 / dockergrep.sh
Created December 9, 2016 08:24
how to grep docker log
docker logs nginx 2>&1 | grep "127."
# ref: http://stackoverflow.com/questions/34724980/finding-a-string-in-docker-logs-of-container
@fideloper
fideloper / update_curl.sh
Last active January 11, 2024 15:23
Update curl on Ubuntu 14.04
#! /usr/bin/env bash
# Install any build dependencies needed for curl
sudo apt-get build-dep curl
# Get latest (as of Feb 25, 2016) libcurl
mkdir ~/curl
cd ~/curl
wget http://curl.haxx.se/download/curl-7.50.2.tar.bz2
tar -xvjf curl-7.50.2.tar.bz2
@CraigChilds94
CraigChilds94 / _breakpoints.scss
Last active August 29, 2015 14:06
A nice way to do breakpoints in Sass
//
// Primary breakpoints
// ===================
// Define the projects breakpoints here. Some sensible defualts are included.
//
/**
* Less than
* =========
*
@planetbeing
planetbeing / gist:9637899
Last active September 12, 2016 12:45
Make FaceTime always on top
lldb --attach-name FaceTime
expr NSArray* $windows = (NSArray*)[(NSApplication*)[NSApplication sharedApplication] windows];
expr unsigned int $count = [$windows count]
expr -- for(unsigned int i = 0; i < $count; ++i) { [(NSWindow*)[$windows objectAtIndex:i] setLevel:5]; }
expr Class $window = (Class)NSClassFromString(@"NSWindow")
expr void* $setLevel = (void*)class_getInstanceMethod($window, @selector(setLevel:))
expr void* $description = (void*)class_getMethodImplementation($window, @selector(description))
call (void)method_setImplementation($setLevel, $description)
process detach
quit
@tehbeard
tehbeard / gist:1292348
Created October 17, 2011 10:24
MC RCON (1.9pr4)
<?php
/*
RCON remote console class, modified for minecraft compability by Tehbeard.
!!!YOU MUST CONFIGURE RCON ON YOUR MINECRAFT SERVER FOR THIS TO WORK
AT TIME OF WRITING ONLY 1.9pr4+ HAVE BUILTIN RCON SUPPORT!!!
Example Code:
============
include_once("rcon.class.php"); //Include this file