Skip to content

Instantly share code, notes, and snippets.

Avatar

Jose Felix Gomez jfgomez86

View GitHub Profile
@jfgomez86
jfgomez86 / NTC503.ino
Created Feb 24, 2017
Just a simple code to measure temperature with a 503 NTC Thermistor. (http://imgur.com/a/zog8f)
View NTC503.ino
// 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 Nov 7, 2013
Simple Capistrano 2.15 deploy.rb file, using rbenv, apache (nginx should work too) and passenger on linode (Ubuntu 12.04 LTS)
View deploy.rb
require 'bundler/capistrano'
# Config Variables
GITHUB_REPOSITORY_NAME = 'project_name'
LINODE_SERVER_HOSTNAME = 'www.host.com'
#############################################
#############################################
@jfgomez86
jfgomez86 / .zshrc
Created Jul 17, 2013
This is a basic setup for development productivity.
View .zshrc
# 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 Jul 4, 2013
My latest powrc config
View .powrc
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
Taskboard definitions
View README.md

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 Dec 17, 2015
Sets up my git aliases
View setup_git_aliases.sh
git config --global alias.co checkout
@jfgomez86
jfgomez86 / deploy.rb
Last active Dec 10, 2015
Most basic server setup checklist for newbs. This list will start growing...hopefully.
View deploy.rb
# 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 Oct 12, 2012
Does this always print your wifi ip address (if you're on a macbook and you're connected to wifi only)?
View gimme_ip.sh
ifconfig -a | grep inet | tail -1 | xargs ruby -e "puts ARGV[1]"
@jfgomez86
jfgomez86 / graph_api.rb
Created Oct 11, 2012
Simple (and incomplete) Facebook Graph API wrapper for public objects. It is incomplete on purpose for a ruby lesson :)
View graph_api.rb
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 Mar 1, 2012 — forked from kathgironpe/precompile_assets.textile
Rails 3.1: Precompile Assets for Cloudfront/CDN support
View precompile_assets.textile

Naming files and using asset_path

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

on config/environments/production.rb