This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AppDelegate | |
def application(application, didFinishLaunchingWithOptions:launchOptions) | |
alert = UIAlertView.new | |
alert.message = "Hello World!" | |
alert.show | |
true | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+- Views | |
+- layout | |
+- application | |
+- mysite | |
+- index | |
+- first page | |
+- second page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Player | |
def initialize birthdate | |
@birthdate = birthdate | |
end | |
def is_old_enough? | |
birthdate < Date.today-18.years | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"bold_folder_labels": true, | |
"color_scheme": "Packages/Color Scheme - Default/Sunburst.tmTheme", | |
"ensure_newline_at_eof_on_save": true, | |
"file_exclude_patterns": | |
[ | |
".DS_Store", | |
".gitkeep", | |
"dump.rdb" | |
], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class WDI | |
#setter | |
def name=name | |
@name = name | |
end | |
#getter | |
def name | |
@name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark' | |
n = 1000000 | |
Benchmark.bm do |x| | |
x.report("Calling {} ") do | |
n.times{ hash = {} } | |
end | |
x.report("Calling Hash.new") do | |
n.times{ hash = Hash.new } | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# COFFEE | |
@func | |
# JS | |
this.func | |
# COFFEE | |
@func() | |
# JS | |
this.func() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def compute operation, a, b | |
result = case operation | |
when 'a' | |
"#{a + b}" | |
when 's' | |
"#{a - b}" | |
when 'm' | |
"#{a * b}" | |
when 'd' | |
"#{a / b}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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(){ |
OlderNewer