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); | |
}; |
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
/* | |
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
// 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
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
export default function get(url, method, options, _callback) { | |
// Allow the options to be optional | |
if (typeof options == 'function') { | |
_callback = options; | |
options = {}; | |
} | |
// Wrap the _callback | |
const callback = function(err) { |
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
# Install git | |
sudo apt-get install git | |
sudo mkdir ~/github/ | |
# Uninstall all previous copies of vim | |
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-common vim-gui-common | |
sudo apt-get build-dep vim-gnome | |
sudo apt-get install python-dev libncurses5-dev | |
sudo rm -rf /usr/local/share/vim | |
sudo rm /usr/bin/vim |
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
$decrease: 4; | |
$initial: 28; | |
@for $i from 1 through 6 { | |
> h#{$i} { | |
// Formula: https://www.desmos.com/calculator/dhrvkbio8f | |
font-size: 1px * ($initial - (2 * $decrease)) + (pow($decrease, 2) / pow(2, $i)); | |
} | |
@if $i < 6 { | |
> h#{$i} + h#{$i+1} { |
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
const microsoft = function(name) { | |
const microsoft = (Math.random() < 0.5) ? 'microsoft ' : ''; | |
const smart = (Math.random() < 0.5) ? 'smart ' : ''; | |
const center = (Math.random() < 0.5) ? ' center' : ''; | |
const fullname = microsoft + smart + name + center; | |
return fullname.trim(); | |
} | |
module.exports = microsoft; |
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
const leftpad = require('left-pad'); | |
const fs = require('fs'); | |
const chars = [ | |
[ | |
'┌─┐', | |
'│ │', | |
'│ │', | |
'│ │', | |
'└─┘', |
OlderNewer