Skip to content

Instantly share code, notes, and snippets.

View jfgomez86's full-sized avatar

Jose Felix Gomez jfgomez86

View GitHub Profile
@jfgomez86
jfgomez86 / NTC503.ino
Created February 24, 2017 15:54
Just a simple code to measure temperature with a 503 NTC Thermistor. (http://imgur.com/a/zog8f)
// include the library code:
#include <LiquidCrystal.h>
#include <math.h>
#define BUTTON_PIN A0
#define THERMISTOR_PIN A1
#define SERIES_RESISTOR 56000.0f
#define SAMPLE_SIZE 100
#define KELVIN 273.15f
@jfgomez86
jfgomez86 / deploy.rb
Created November 7, 2013 21:35
Simple Capistrano 2.15 deploy.rb file, using rbenv, apache (nginx should work too) and passenger on linode (Ubuntu 12.04 LTS)
require 'bundler/capistrano'
# Config Variables
GITHUB_REPOSITORY_NAME = 'project_name'
LINODE_SERVER_HOSTNAME = 'www.host.com'
#############################################
#############################################
@jfgomez86
jfgomez86 / .zshrc
Created July 17, 2013 19:56
This is a basic setup for development productivity.
# My Projects shortcut function:
PROJECTS_DIR="/Users/me/Projects"
p() {
PROJECT_NAME="$1";
cd "$PROJECTS_DIR/$PROJECT_NAME";
}
_projects_list() {
reply=($(ls $PROJECTS_DIR))
}
@jfgomez86
jfgomez86 / .powrc
Created July 4, 2013 19:14
My latest powrc config
if [ -f "$rvm_path/scripts/rvm" ]; then
source "$rvm_path/scripts/rvm"
if [ -f ".ruby-version" ]; then
rvm use `cat .ruby-version`
fi
if [ -f ".ruby-gemset" ]; then
rvm gemset use `cat .ruby-gemset`
fi
@jfgomez86
jfgomez86 / README.md
Created May 30, 2013 20:16
Taskboard definitions

Kanban Taskboard definitions

Definition of Done

  • Task was reviewed and approved by Product Owner
  • If there's a production server, the task is already deployed to it
  • Task complies with the definition of Review
@jfgomez86
jfgomez86 / setup_git_aliases.sh
Last active December 17, 2015 04:59
Sets up my git aliases
git config --global alias.co checkout
@jfgomez86
jfgomez86 / deploy.rb
Last active December 10, 2015 13:59
Most basic server setup checklist for newbs. This list will start growing...hopefully.
# Bundler Integration
# http://github.com/carlhuda/bundler/blob/master/lib/bundler/capistrano.rb
require 'bundler/capistrano'
# Application Settings
set :application, "washa"
set :user, "www"
set :deploy_to, "/home/#{user}/#{application}/web"
set :rails_env, "production"
set :use_sudo, false
@jfgomez86
jfgomez86 / gimme_ip.sh
Created October 12, 2012 14:15
Does this always print your wifi ip address (if you're on a macbook and you're connected to wifi only)?
ifconfig -a | grep inet | tail -1 | xargs ruby -e "puts ARGV[1]"
@jfgomez86
jfgomez86 / graph_api.rb
Created October 11, 2012 14:38
Simple (and incomplete) Facebook Graph API wrapper for public objects. It is incomplete on purpose for a ruby lesson :)
require 'rubygems'
require 'open-uri'
require 'json'
require 'ostruct'
def get_graph_object(object_id)
graph_json = open("https://graph.facebook.com/#{object_id}").read
data_hash = JSON.parse(graph_json)
parsed_hash = parse_hash(data_hash)
@jfgomez86
jfgomez86 / precompile_assets.textile
Created March 1, 2012 20:41 — forked from kathgironpe/precompile_assets.textile
Rails 3.1: Precompile Assets for Cloudfront/CDN support

Naming files and using asset_path

application.scss.erb
- use <%= asset_path 'background.jpg' %>

on config/environments/production.rb