This file contains hidden or 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 Inverter = React.createClass({ | |
getInitialState: function() { | |
return { | |
text: "" | |
}; | |
}, | |
textChange: function(event) { | |
this.setState({ | |
text: event.target.value | |
}); |
This file contains hidden or 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
// Easier sql queries | |
class EasyQuery { | |
private $dbname; | |
private $db; | |
public function __construct($dbname) { | |
$this->dbname = $dbname; | |
// Check if the db file exists | |
if (!file_exists($this->dbname)) { |
This file contains hidden or 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
/* | |
Iterate over an object | |
*/ | |
Object.prototype.map = function(cb) { | |
Object.keys(this).map(function(item) { | |
if (this.hasOwnProperty(item)) { | |
this[item] = cb(item, this[item], this); | |
} | |
}.bind(this)); | |
return this; |
This file contains hidden or 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
[bananas].map (item) -> | |
item.map (item) -> | |
item.defaultValues=monkey.defaultValues |
This file contains hidden or 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 asyncAlert(m){ | |
setTimeout(function(){ | |
alert(m); | |
},1); | |
}; |
NewerOlder