Skip to content

Instantly share code, notes, and snippets.

View chyld's full-sized avatar
:electron:
import numpy

Chyld Medford chyld

:electron:
import numpy
View GitHub Profile
@chyld
chyld / Installation of Ruby 1.9.2, Rails 3, MongoDB 1.6.5 on Ubuntu 10.10 64 bit Amazon EC2 image
Created February 3, 2011 23:08
Install Ruby, Rails, MongoDB on Amazon EC2 Ubuntu image with Sample Applicaton
#amazon ec2 image
#ubuntu 10.10, 64bit : ami-cef405a7
#to add additional ebs storage to your instance
#goto volumes and create a volume in the same zone as the instance
#after it is created, attach the volume to the instance
Attachment Information:i-dbb12eb7:/dev/sdp (attached)
#ssh to ec2
ssh -i <key-file>.pem ubuntu@<ip-address-to-ec2>
@chyld
chyld / Install Ruby, MySql on Ubuntu 10.10 on Amazon EC2
Created February 9, 2011 02:11
Install Ruby, Rails, MySql, Apache, Passenger on Ubuntu 10.10 on Amazon EC2
#amazon ec2 image
#ubuntu 10.10, 64bit
#east-coast : ami-cef405a7
#west-coast : ami-af7e2eea
#ssh to ec2
ssh -i <key-file>.pem ubuntu@<ip-address-to-ec2>
#change ssh timeouts
sudo vi /etc/ssh/sshd_config
@chyld
chyld / gist:1340259
Created November 4, 2011 19:29
vimrc file
" http://vimdoc.sourceforge.net/htmldoc/options.html
set nocompatible
syntax on
filetype plugin indent on
filetype indent on
set number " turn on line numbering
set wrap! " turn off word wrapping
set smartindent " enable smart indent
@chyld
chyld / gist:2885434
Created June 6, 2012 23:15
Rails on Mint Linux
- run software update
- change wallpaper
- change window border theme
http://linuxmint-art.org/content/show.php/Dust+Blue+Metacity?content=91808
- replace mate-terminal with gnome-terminal
sudo apt-get install gnome-terminal
- update shortcut link on menu to use gnome-terminal
@chyld
chyld / gist:2898017
Created June 8, 2012 20:36
Pry Commands
core:
----------
!
;
show-input
amend-line
edit
hist
play
cd
@chyld
chyld / gist:2946012
Created June 17, 2012 23:08
Rails, Pry, Pow notes
rails new experimental
rm public/index.html
pry -r ./config/environment
rails generate scaffold Product name:string description:text price:decimal
in application.js (for example)
*** require_tree . # loads all files recursively
*** require_directory . # loads only files in the current directory
Rails.application.config.assets.paths # search path for assets
other.js.coffee.erb # preprocessors - erb is 1st, coffee is 2nd and final output is js
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
@chyld
chyld / gist:2954687
Created June 19, 2012 15:08
skillshare rails class
About:
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
This is an intermediate course on Ruby on Rails. I will lead you from a beginner,
novice Rails developer to an intermediate one. After this class you will have the
tools and knowledge you need to create solid, professional Rails applications.
Schedule:
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
The class will meet for 7 sessions on Sunday (noon to 3pm) and Monday (6pm to 8pm).
The first class will begin on Monday, August 6 and the last class will be Monday, August 27.
#import <UIKit/UIKit.h>
@interface CMViewController : UIViewController
<UITextFieldDelegate>
{
NSMutableArray* words;
IBOutlet UITextField* mytext;
}
@chyld
chyld / gist:3086429
Created July 10, 2012 21:47
ios string concat and type conversion
- (IBAction)concatFields:(id)sender
{
//NSString* s = field1.text;
//label.text = [s stringByAppendingString:field2.text];
float f1 = field1.text.floatValue;
float f2 = field2.text.floatValue;
NSNumber* n = [NSNumber numberWithFloat:f1*f2];
label.text = n.stringValue;
IWD 2 Final Project:
(5 points) - Create a new rails app called HappiTails
(5 points) - Create a Animal scaffold - it should have photo, name, type (dog or cat), age, gender
(5 points) - Create a Shelter scaffold - should have photo, name, address
(5 points) - Check presence on all names on all models
(5 points) - Check uniqueness of names on all models
(5 points) - Check age on all models should be greater than zero
(5 points) - Create a logo, header and footer that should be visible on all pages
(5 points) - Create a home page that should describe the HappiTails website