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 f() {} | |
f.prototype.a = 1 | |
// f.prototype.a is 1 | |
x = Object.create(f) | |
// x.prototype.a is 1 | |
x.prototype.a = 2 | |
// both x.prototype.a and f.prototype.a are 2 |
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 obj = {a: {b: 1}}; | |
getIf(obj, 'a'); // => {b: 1} | |
getIf(obj, 'absentProp'); // => undefined | |
getIf(obj, 'a', 'b'); // => 1 | |
getIf(obj, 'a', 'b', 'absentNestedProp'); // => undefined |
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
[href$='#inbox'] { | |
visibility: hidden; | |
} | |
[href$='#inbox']:before { | |
content: 'Inbox'; | |
visibility: visible; | |
} |
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
~/myapp$ bundle exec rake --trace sitemap:create | |
In ~/myapp | |
rake aborted! | |
undefined local variable or method `location' for #<#<Class:0xb050c20>:0xb050bd0> | |
Tasks: TOP => sitemap:create | |
(See full trace by running task with --trace) | |
evanrmurphy@inspiron1520:~/Work/rails_projects/myapp$ bundle exec rake --trace sitemap:create | |
** Invoke sitemap:create (first_time) | |
** Invoke sitemap:require_environment (first_time) |
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 http-equiv="Content-Type" content="text/html;charset=utf-8"> | |
<title>Try LavaScript</title> | |
<!-- | |
Copyright 2011 Ross Angle (rocketnia). This file is released under | |
the Perl Foundation's Artistic License 2.0. | |
Not covered by the license are Underscore, jQuery, jQuery-console, |
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 http-equiv="Content-Type" content="text/html;charset=utf-8"> | |
<title>Try LavaScript</title> | |
<!-- | |
Copyright 2011 Ross Angle (rocketnia). This file is released under | |
the Perl Foundation's Artistic License 2.0. | |
Not covered by the license are Underscore, jQuery, jQuery-console, |
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 foo | |
(prn "hello world!")) |
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
# Trying to write a simplified let macro to learn PicoLisp | |
# In arc this could be expressed as: | |
# | |
# (mac mylet (var val . body) | |
# `((fn (,var) ,@body) ,val)) | |
# | |
# I've tried to translate this into PicoLisp below, but it is | |
# not working. | |
(de mylet (@var @val . @body) |
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
3 3 + x set! | |
this that the_other dofunc | |
4 5 + y set! | |
3 3 + | |
x | |
set! | |
this that the_other dofunc | |
4 5 + |
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
personUpdateSternness = (function() { | |
return ((this.laughter==0) ? this.sternness=true | |
: (this.laughter>5) ? this.sternness=null | |
: null), | |
this.sternness; | |
}), | |
personUpdateLaughter = (function() { | |
return (!this.sternness ? (this.laughter += 10) | |
: (--this.laughter, |
NewerOlder