Skip to content

Instantly share code, notes, and snippets.

View blackjid's full-sized avatar
🎹

Juan Ignacio Donoso blackjid

🎹
View GitHub Profile
@blackjid
blackjid / vj-story.rb
Created April 23, 2014 21:28
Vj Archive test for rhinobird
def prepare
# Download the files
for stream in @stream_urls do
system("curl -O https://s3.amazonaws.com/media-rhinobird.tv/#{stream[:name]}") unless File.exists?(stream[:name])
end
# Create a tmp dir
system("rm -rf tmp && mkdir tmp")
system("rm -f video_story.txt")
system("rm -f audio_story.txt")
@blackjid
blackjid / README.md
Last active August 29, 2015 14:01
Google Calendar Attendees widget for Dashing

Description

A Dashing widget for displaying the number of attendees for a specific calendar event on Google Calendar

It's specially designed to be used against a recursive event. For example, we use it at platanus to show how many people and who is going to have lunch in the office.

screen shot

Made by platanus in Chile

@blackjid
blackjid / docker-compose.yml
Last active August 29, 2015 14:27
Hound with Docker and Rancher
app:
ports:
- 3000/tcp
environment:
CHANGED_FILES_THRESHOLD: '300'
ENABLE_HTTPS: 'no'
EXEMPT_ORGS: platanus
GITHUB_CLIENT_ID: <GITHUB_CLIENT_ID>
GITHUB_CLIENT_SECRET: <GITHUB_CLIENT_SECRET>
HOST: monkeyci.platan.us
app:
image: platanus/hound
ports:
- 3000
volumes:
- /usr/src/app
links:
- db
- redis
env_file: .env.production
@blackjid
blackjid / dateDjango.js
Created April 19, 2012 16:53
Create a Javascript date object with the time synced with the server time. The code must be processed in the server.
// Django template
(function(){
var _date = new Date();
date = {
gmtOffset: {% now "Z" %},
offset: {% now "U" %} - Math.round(_date.getTime() / 1000),
now: function(unix){
if(unix)
return Math.round(_date.getTime() / 1000) + this.offset + _date.getTimezoneOffset()*60*1000 + this.gmtOffset*1000;
return new Date(((Math.round(_date.getTime() / 1000) + this.offset)*1000) + _date.getTimezoneOffset()*60*1000 + this.gmtOffset*1000);
@blackjid
blackjid / gist:2628871
Created May 7, 2012 16:41
A clean way to get data from a form element using the submit event
//Requires underscore, jquery
$(document).on('submit', 'selector.to.the.form.element', function(e){
// The the data from the form
var formData = _.reduce($(e.currentTarget).serializeArray(), function(memo, val){
memo[val.name] = val.value;
return memo;
},{});
@blackjid
blackjid / noroot-ams.js
Created October 6, 2015 23:39
Rootless Ams Style for Restmod
angular.module('restmod').factory('RootlessAMSApi', ['restmod', 'inflector', function(restmod, inflector) {
return restmod.mixin({ // include default packer extension
$config: {
style: 'AMS',
primaryKey: 'id',
jsonMeta: 'meta',
jsonLinks: 'links'
},
@blackjid
blackjid / gist:3915929
Created October 19, 2012 02:30
History search binding
bind '"\M-[A":history-search-backward'
bind '"\M-[B":history-search-forward'

Keybase proof

I hereby claim:

  • I am blackjid on github.
  • I am blackjid (https://keybase.io/blackjid) on keybase.
  • I have a public key whose fingerprint is 757E 3CF8 FEA0 5AB7 5A64 674D D8CA 2216 DC8C 02DD

To claim this, I am signing this object:

@blackjid
blackjid / nginx-init-deb.sh
Created January 23, 2013 16:03
Init script for Nginx in Debian
#! /bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the nginx web server
# Description: starts nginx using start-stop-daemon