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
Function::hasProperties = (properties) -> | |
self = @ | |
self.prototype.properties = {} | |
definePropertie = (key, value) -> | |
self.prototype.properties[key] = value | |
self.prototype[key] = (newValue) -> | |
@properties[key] = newValue | |
@ | |
for key, value of properties | |
definePropertie key, value |
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
var AClass = new Class({ | |
Implements: [ExtendedLogger], | |
initialize: function() { | |
this.initLogger('AClass', { | |
skip: ['silentMethod'], | |
debug: true | |
}); | |
this.silentMethod(); | |
this.otherMethod(); | |
}, |
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> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8"> | |
<title>Events Flow</title> | |
<style type="text/css" media="screen"> | |
div { | |
background-color: #ddd; | |
padding: 40px; | |
border: 1px solid white; | |
} |
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> | |
<meta charset=utf-8 /> | |
<title>Media querys IE fallback</title> | |
<style> | |
p { | |
color: blue; | |
} |
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
var tmp = 1; | |
function foo(x) { | |
var tmp = 2; | |
return function (y) { | |
alert(x + y + (++tmp)); | |
} | |
} | |
var bar = foo(3); | |
bar(tmp); | |
bar(tmp); |
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
git tag bad HASH | |
git co bad | |
git commit --ammend | |
git rebase --onto HEAD bad master | |
git tag -d bad |
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> | |
<head> | |
<title>FooBar spaguetti riddle</title> | |
<meta charset='utf-8'> | |
<script type="text/javascript" src="http://shjs.sourceforge.net/sh_main.js"></script> | |
<script src="http://shjs.sourceforge.net/lang/sh_javascript.js" type="text/javascript" charset="utf-8"></script> | |
<link rel="stylesheet" href="http://shjs.sourceforge.net/css/sh_the.css" type="text/css" media="screen" charset="utf-8"> | |
<style type="text/css" media="screen"> |
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 tip(msg); puts; puts msg; puts "-"*100; end | |
# | |
# 30 Ruby 1.9 Tips, Tricks & Features: | |
# http://www.igvita.com/2011/02/03/new-ruby-19-features-tips-tricks/ | |
# | |
tip "Upgrading to Ruby 1.9 is simple: rvm install 1.9.2 && rvm --default 1.9.2" | |
tip "Ruby 1.9 supports named captures in regular expressions!" |
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 'test_helper' | |
class VideoTest < ActiveSupport::TestCase | |
test "should accept only valid urls" do | |
video = Video.new | |
assert(video.invalid?) # blank urls are not accepted | |
invalid_urls = # valid but not accepted | |
%w{ |
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
git config --global svn.addAuthorFrom true | |
git config --global svn.useLogAuthor true | |
git svn clone NEW_URL new | |
git svn clone ORIGINAL_URL original | |
cd original | |
git push ../new/.git master:refs/heads/original | |
cd ../new | |
git filter-branch --msg-filter 'sed -e /^git-svn-id:/d' original | |
echo `git rev-list original | tail -1` `git rev-list master | tail -1` >> .git/info/grafts | |
git merge original |