Skip to content

Instantly share code, notes, and snippets.

zcourts /
Created May 7, 2014
Because the standard install doesn't always work!
cd /tmp
git clone
cd zeromq4-x
make install
View showspreadsheet.php
// Parsing this spreadsheet:
$url = '';
$file= file_get_contents($url);
$json = json_decode($file);
$rows = $json->{'feed'}->{'entry'};
foreach($rows as $row) {
echo '<p>';
andrew / leaderboard.rb
Last active Dec 10, 2015
Get a leaderboard of contributions in your GitHub organization
View leaderboard.rb
## Contribution leaderboard
# Get a leaderboard of contributions in your org
# usage: $ USERNAME=yourusername PASSWORD=yourpassword ORG=yourorgname ruby leaderboard.rb
# n.b requires the octokit and mechanize gems
require 'rubygems'
require 'octokit'
Swop / Screencast to GIF file
Last active Dec 11, 2015
Simple steps to create a GIF from a screencast (OSX but works with Linux)
View Screencast to GIF file
# Install ffmepg (for the screencast) & imagemagick (to optimize the GIF file for web usage)
brew install ffmpeg
brew install imagemagick
# Make the screencast and compress it
ffmpeg -i -pix_fmt rgb24 output.gif
convert -layers Optimize output.gif output_optimized.gif
# Upload it somewere in the cloud...
# ... and use the file in the desire website. Here's the markdown syntax:
andrew / contributions.rb
Last active Dec 12, 2015
Who's done more work on your repo, you or your community?
View contributions.rb
require 'json'
require 'open-uri'
repo = ENV['REPO']
owner = ENV['OWNER'] || repo.match(/(.+)\//)[1]
url = "{repo}/graphs/contributors-data"
doc = open(url).read
if doc == ' ' # retry if data not loaded
sleep 2
doc = open(url).read
View check_directory_exist.yml
# Attempt to check if the folder exist.
# If it exist echo out a string. You have to echo something
# if the directory does exist or else the task is considered failed
# Output is set to $is_default_created. Note that this variable is
# object and not an atomic value.
- name: Attempt to check if a directory exist
action: shell test -d /my/folder && echo "exist" || echo ""
register: is_folder_created
jgarber / gist:5893179
Last active Dec 19, 2015
Setting up motion with a raspberry pi camera
View gist:5893179
ssh-copy-id pi@192.168.X.X
# on the pi
sudo su -
cat <<EOF >> /etc/wpa_supplicant/wpa_supplicant.conf
ssid="Your SSID Here"
View gist:ba6b78e24c315a7f5e3c
* @BeforeScenario
public function captureConsoleLog() {
if (!($this->getSession()->getDriver() instanceof \Behat\Mink\Driver\Selenium2Driver)) {
// Not a Selenium driver (e.g. PhantomJs).
View Laravel Controller
class evidenceController {
public function getDetails($id){
$course = Course::with(['courseType'])
$view = View::make('courses/parts/details')
->with('course', $course);
fordnox /
Created Sep 25, 2011
Install Jenkins server on Ubuntu
sudo apt-get update
sudo apt-get install openjdk-6-jre
sudo apt-get install openjdk-6-jdk
sudo wget -q -O - | sudo apt-key add -
sudo sh -c 'echo deb binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt-get update
sudo apt-get install jenkins
sudo apt-get install ant