View install-zmq-on-osx.sh
cd /tmp | |
git clone git@github.com:zeromq/zeromq4-x.git | |
cd zeromq4-x | |
./autogen.sh | |
./configure | |
make | |
make install | |
View showspreadsheet.php
<?php | |
// Parsing this spreadsheet: https://spreadsheets.google.com/pub?key=0Ah0xU81penP1dFNLWk5YMW41dkcwa1JNQXk3YUJoOXc&hl=en&output=html | |
$url = 'http://spreadsheets.google.com/feeds/list/0Ah0xU81penP1dFNLWk5YMW41dkcwa1JNQXk3YUJoOXc/od6/public/values?alt=json'; | |
$file= file_get_contents($url); | |
$json = json_decode($file); | |
$rows = $json->{'feed'}->{'entry'}; | |
foreach($rows as $row) { | |
echo '<p>'; |
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' |
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 ScreenFlow.mov -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: |
View contributions.rb
require 'json' | |
require 'open-uri' | |
repo = ENV['REPO'] | |
owner = ENV['OWNER'] || repo.match(/(.+)\//)[1] | |
url = "https://github.com/#{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 |
View gist:5893179
ssh-copy-id pi@192.168.X.X | |
# on the pi | |
sudo su - | |
cat <<EOF >> /etc/wpa_supplicant/wpa_supplicant.conf | |
network={ | |
ssid="Your SSID Here" | |
proto=RSN | |
key_mgmt=WPA-PSK | |
pairwise=CCMP |
View gist:ba6b78e24c315a7f5e3c
<?php | |
/** | |
* @BeforeScenario | |
*/ | |
public function captureConsoleLog() { | |
if (!($this->getSession()->getDriver() instanceof \Behat\Mink\Driver\Selenium2Driver)) { | |
// Not a Selenium driver (e.g. PhantomJs). | |
return; | |
} |
View Laravel Controller
<?php | |
class evidenceController { | |
public function getDetails($id){ | |
$course = Course::with(['courseType']) | |
->checkEstablishmentOnView() | |
->excludeArchived() | |
->findOrFail($id); | |
$view = View::make('courses/parts/details') | |
->with('course', $course); |
View jekins_server.sh
#!/bin/sh | |
sudo apt-get update | |
sudo apt-get install openjdk-6-jre | |
sudo apt-get install openjdk-6-jdk | |
sudo wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add - | |
sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list' | |
sudo apt-get update | |
sudo apt-get install jenkins | |
sudo apt-get install ant |
OlderNewer