Skip to content

Instantly share code, notes, and snippets.

View j7's full-sized avatar

Javier Carballo j7

View GitHub Profile
@j7
j7 / logout-timer.coffee
Last active August 29, 2015 14:10
Javascript Logout Timer with Bootstrap Modal
idleTime = 0
@logOutUser = ->
$("#main-sign-out").click()
@cancelAutoLogOutTimer = ->
clearTimeout(window.autoLogOutTimerID)
timerIncrement = ->
idleTime = idleTime + 1
@j7
j7 / gist:9367435
Last active August 29, 2015 13:57 — forked from ctavan/gist:4482825
Redis Cluster
#! /bin/bash
### BEGIN INIT INFO
# Provides: redis-server
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: redis-server - Persistent key-value db
@j7
j7 / unicorn_init.sh
Created September 8, 2013 19:25
Unicorn Init File
#!/bin/sh
### BEGIN INIT INFO
# Provides: unicorn
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Manage unicorn server
# Description: Start, stop, restart unicorn server for a specific application.
### END INIT INFO
@j7
j7 / basecamp.rb
Created September 8, 2013 12:38
Skinny Basecamp API Wrapper in Ruby ( BCX )
# User omniauth with the omniauth-basecamp strategy to authenticate. And, store the token that you receive.
# To connect to the API create an instance of the wrapper:
# @basecamp = Basecamp.new(token), at this point only .accounts will work, use that get the account
# id of the account you want to connect. After that, just passs the accout id to the connection, @basecamp = Basecamp.new(token, account_id)
# and feel free to call any method.
#
# By Javier Carballo, javier@javier.im.
class Basecamp
def initialize(token, account_id = nil, app = nil)
@token = token
@j7
j7 / hack.sh
Last active December 15, 2015 03:59 — forked from erikh/hack.sh
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://gist.github.com/j7/5198553/hack.sh | sh
#
@j7
j7 / Gemfile
Last active December 11, 2015 14:19
FIX: ActionView::Template::Error ('twitter/bootstrap/bootstrap.less' wasn't found.
gem 'twitter-bootstrap-raills' necesita estar fuera de group :assets.
Tendria que se algo asi en el Gemfile:
gem 'twitter-bootstrap-rails'
group :assets do
..
end