Skip to content

Instantly share code, notes, and snippets.

View rdegraci's full-sized avatar

Rodney Degracia rdegraci

View GitHub Profile
# install java 8
sudo add-apt-repository -y ppa:webupd8team/java
sudo apt-get update
sudo apt-get -y install oracle-java8-installer
java -version
# install elasticsearch
wget https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/deb/elasticsearch/2.3.5/elasticsearch-2.3.5.deb
sudo dpkg -i elasticsearch-2.3.5.deb
sudo update-rc.d elasticsearch defaults
train_set = [ # A AND NOT B
[0,0,0],
[0,1,0],
[1,0,1],
[1,1,0],
]
n=30
layers = [2, 2, 1]
apt-get install openjdk-7-*
addgroup hadoop
adduser --ingroup hadoop hduser
sudo -u hduser bash
ssh-keygen -t rsa -P ""
cat /home/hduser/.ssh/id_rsa.pub >> /home/hduser/.ssh/authorized_keys
-(void)zoomToFitMapAnnotations:(MKMapView*)mapView
{
if([mapView.annotations count] == 0)
return;
CLLocationCoordinate2D topLeftCoord;
topLeftCoord.latitude = -90;
topLeftCoord.longitude = 180;
CLLocationCoordinate2D bottomRightCoord;
# Original from http://snippets.dzone.com/posts/show/4468 by MichaelBoutros
#
# Optimized version which uses to_yaml for content creation and checks
# that models are ActiveRecord::Base models before trying to fetch
# them from database.
namespace :db do
namespace :fixtures do
desc 'Dumps all models into fixtures.'
task :dump => :environment do
@rdegraci
rdegraci / oa-openid_override.rb
Created September 20, 2011 18:51 — forked from Vaevictusnet/oa-openid_override.rb
config/initializers/omniauth.rb
require 'omniauth/openid'
require 'openid/store/filesystem'
module OmniAuth
class Form
def shard_field(name)
@html << "\n<select id='#{name}' name='#{name}'>"
@html << "\n<option value='amunet' selected='selected'>Tale 5: Amunet</option>"
@html << "\n<option value='bastet'>Tale 5: Bastet</option>"
@html << "\n<option value='c'>Tale 6</option>"