Skip to content

Instantly share code, notes, and snippets.

View jcalonso's full-sized avatar

Juan Carlos Alonso jcalonso

View GitHub Profile
@zcourts
zcourts / install-zmq-on-osx.sh
Created May 7, 2014 11:39
Because the standard install doesn't always work!
cd /tmp
git clone git@github.com:zeromq/zeromq4-x.git
cd zeromq4-x
./autogen.sh
./configure
make
make install
<?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>';
@andrew
andrew / leaderboard.rb
Last active December 10, 2015 23:38
Get a leaderboard of contributions in your GitHub organization
## 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
Swop / Screencast to GIF file
Last active December 11, 2015 10:48
Simple steps to create a GIF from a screencast (OSX but works with Linux)
# 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:
---
# 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
jgarber / gist:5893179
Last active December 19, 2015 03:49
Setting up motion with a raspberry pi camera
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
<?php
/**
* @BeforeScenario
*/
public function captureConsoleLog() {
if (!($this->getSession()->getDriver() instanceof \Behat\Mink\Driver\Selenium2Driver)) {
// Not a Selenium driver (e.g. PhantomJs).
return;
}
<?php
class evidenceController {
public function getDetails($id){
$course = Course::with(['courseType'])
->checkEstablishmentOnView()
->excludeArchived()
->findOrFail($id);
$view = View::make('courses/parts/details')
->with('course', $course);
@fordnox
fordnox / jekins_server.sh
Created September 25, 2011 10:22
Install Jenkins server on Ubuntu
#!/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
@andrewrocco
andrewrocco / ga-ratio.js
Created July 17, 2012 15:48
Pixel Aspect Ratio Google Analytics Custom Variable
// Create the test
var pixelRatio = (window.devicePixelRatio >= 1.5) ? "high" : "normal";
..
// Pass it along through GA
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-xxxxxxxx-x']);
// --- IMPORTANT LINE!
// params: event method, custom variable slot, variable name, variable value, scope level