Skip to content

Instantly share code, notes, and snippets.

View randito's full-sized avatar
:octocat:
(⊙_⊙)

Randy Pond randito

:octocat:
(⊙_⊙)
View GitHub Profile
@randito
randito / todos_controller.coffee
Created March 27, 2014 16:03
Ember example controller (in coffeescript)
# From: http://emberjs.com/guides/getting-started/creating-a-new-model/
Todos.TodosController = Ember.ArrayController.extend
actions:
createTodo: ->
title = @get 'newTitle'
return unless title.trim()
@set 'newTitle', ''
@store.createRecord 'todo',
title: title
@randito
randito / _README.md
Created December 10, 2009 20:40 — forked from kneath/_README.md
Github's javascript strategy

GitHub Javascript Strategy

Unless otherwise necessary (such as mobile development), the GitHub javascript codebase is based off jQuery. You can safely assume it will be included on every page.

File naming

  • All jquery plugins should be prefixed with jquery, such as jquery.facebox
  • All github-specific jquery plugins should be prefixed with jquery.github. Like jquery.github.repo_list.js
  • All page-specific files (that only run on ONE page) should be prefixed with page. page.billing.js
@randito
randito / Evolution of a Python programmer.py
Created January 29, 2010 21:00
Different types of factorials
#Newbie programmer
def factorial(x):
if x == 0:
return 1
else:
return x * factorial(x - 1)
print factorial(6)
#First year programmer, studied Pascal
@randito
randito / .aliases
Created February 12, 2010 05:08 — forked from jlong/.aliases
Sample dot files
# Console
alias profile="vi ~/.bash_profile"
alias ls="ls -p -G -h"
# Desktop Programs
alias fireworks="open -a '/Applications/Adobe Fireworks CS3/Adobe Fireworks CS3.app'"
alias photoshop="open -a '/Applications/Adobe Photoshop CS4/Adobe Photoshop.app'"
alias illustrator="open -a '/Applications/Adobe Illustrator CS4/Adobe Illustrator.app'"
alias preview="open -a '/Applications/Preview.app'"
alias xcode="open -a '/Developer/Applications/Xcode.app'"
@randito
randito / example_note_keeping_app.rb
Created February 16, 2010 20:15 — forked from pietern/example_note_keeping_app.rb
Example Sintra app for note taking
require 'rubygems'
require 'sinatra'
require 'redis'
# To use, simply start your Redis server and boot this
# example app with:
# ruby example_note_keeping_app.rb
#
# Point your browser to http://localhost:4567 and enjoy!
#
= Ruby Packaging Standard
The aim of this document is to specify a common structure of how a
Ruby package distributed as source (that is, but not limited to,
development directories, version-controlled repositories, .tar.gz,
Gems, ...) should conform to.
(See RFC 2119 for use of MUST, SHOULD, SHALL.)
== Library files
// CSS buttons courtesy of http://www.zurb.com/article/266/super-awesome-buttons-with-css3-and-rgba
// Converted to sass via css2sass and then parameterized
=zurb_button
background: #222 url(/images/alert-overlay.png) repeat-x
display: inline-block
padding: 5px 10px 6px
color: #fff
text-decoration: none
development: &global_settings
database: textual_development
host: 127.0.0.1
port: 27017
test:
database: textual_test
<<: *global_settings
production:
alias reload='. ~/.bashrc'
alias ea="$EDITOR ~/bin/dotfiles/bash/aliases && reload"
alias ee="$EDITOR ~/bin/dotfiles/bash/env && reload"
alias eh="$EDITOR ~/bin/dotfiles/bash/heroku && reload"
# Processes
alias tu='top -o cpu'
alias tm='top -o vsize'
# Projects
require 'rubygems'
require 'sinatra'
require 'redis'
# To use, simply start your Redis server and boot this
# example app with:
# ruby example_note_keeping_app.rb
#
# Point your browser to http://localhost:4567 and enjoy!
#