##Set by students
No phones, no chat with classmates during class/lessons Patience, understanding with each other Don't be distracted by social media/video games Keep the classroom tidy Collaborate with each other
#the command below will look at ALL objects in history and show you the biggest ones | |
git rev-list --all --objects | | |
sed -n $(git rev-list --objects --all | cut -f1 -d' ' | git cat-file --batch-check | grep blob | sort -n -k 3 | tail -n40 | while read hash type size; do echo -n "-e s/$hash/$size/p "; done) | sort -n -k1 | |
#the command below will remove all reference for a given file | |
git filter-branch --force --index-filter 'git rm --cached -r --ignore-unmatch REPLACE_WITH_PATH' --prune-empty --tag-name-filter cat -- --all | |
# remove old referenes | |
rm -rf .git/refs/original/ | |
# remove old referenes | |
git reflog expire --expire=now --all | |
# recreate referenes |
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
When /^I send (.*) (GET|POST|PUT|DELETE) request to (.* path)(?: with:)?$/ do |format, method, path, *body| | |
headers = case format | |
when /xml/i | |
{ 'CONTENT_TYPE' => 'text/xml' } | |
when /json/i | |
{ 'CONTENT_TYPE' => 'application/json' } | |
else | |
{} | |
end |
url = "http://www.google.com" | |
params_hash = {:param_1=>"value_1", :param_2=>"value_2"} | |
parameterized = params_hash.map{ |k,v| "#{k}=#{v}" }.join("&") | |
[url, "?", parameterized].join #=> http://www.google.com?param_1=value_1¶m_2=value_2 |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Jquery events</title> | |
<style> | |
#mouseHover{ width:500px; height: 500px; background-color: red} | |
</style> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> | |
<script> | |
$(function(){ |
def compute operation, a, b | |
result = case operation | |
when 'a' | |
"#{a + b}" | |
when 's' | |
"#{a - b}" | |
when 'm' | |
"#{a * b}" | |
when 'd' | |
"#{a / b}" |
App.MyView = Ember.View.extend({ | |
tagName: "td", | |
my_function: function(){ | |
alert("Do stuff here") | |
//in this context, you should be able to get content directly by the key , like this.get('myKey') | |
// and the controller is available via this.get('controller') | |
}, | |
click: function(){ | |
my_function() |
# COFFEE | |
@func | |
# JS | |
this.func | |
# COFFEE | |
@func() | |
# JS | |
this.func() |