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
Applications 42G total | |
Library 8.6G total | |
Users 109G total | |
System 6.3G total | |
usr 4.4G total | |
private 4.8G total | |
---- | |
Total 175.1G / 181G used / 51G available / 233G total | |
Applications 50G total |
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
(defn qsort [[pivot & xs]] | |
(when pivot | |
(let [smaller #(< % pivot)] | |
(lazy-cat (qsort (filter smaller xs)) | |
[pivot] | |
(qsort (remove smaller xs)))))) |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Hello World</title> | |
<script src="http://fb.me/react-0.13.3.js"></script> | |
</head> | |
<body> | |
<script type="text/javascript"> | |
var App = React.createClass({ | |
render: function() { |
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
(def registrar (ref #{})) | |
(defrecord Person [first-name last-name]) | |
(def rick (->Person "Rick" "James")) | |
(def charlie (->Person "Charlie" "Murphy")) | |
(dosync | |
(alter registrar conj rick) | |
(alter registrar conj charlie)) |
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
// first, we have an object | |
> var o = { a: 'b', c: 'd' }; | |
undefined | |
// then we can find its children | |
> var v = Object.keys(o).map(function(key) { return o[key]; }); // [ 'b', 'd' ] | |
undefined | |
// finally, we can pass values through a promise chain, | |
// where they might be acted upon asynchronously |
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
// wat. do less of this. | |
/*var facet = ''; | |
for (var item in req.facetsConfigData) { | |
if (req.facetsConfigData[item].channel_id == req.query.channel) { | |
facet = req.facetsConfigData[item].type; | |
}}*/ | |
// and more of this | |
var facet = _.filter(req.affiliate.config.facets, function(facet) { if (facet.channel_id == req.query.channel) return true; else return false; })[0]; |
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 flags = { | |
testTransform: (true && true), | |
another: (true && false) | |
} | |
var transforms = { | |
testTransform: { | |
apply: flags.testTransform, | |
function: function(name) { return `${name}!`; } | |
}, |
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
{ | |
// http://eslint.org/docs/rules/ | |
"ecmaFeatures": { | |
"binaryLiterals": false, // enable binary literals | |
"blockBindings": false, // enable let and const (aka block bindings) | |
"defaultParams": false, // enable default function parameters | |
"forOf": false, // enable for-of loops | |
"generators": false, // enable generators | |
"objectLiteralComputedProperties": false, // enable computed object literal property names |
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
resp = test.get bing_web_url, bing_params.merge(bing_hl_params) | |
puts resp.inspect |
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 getRandomDirection() { | |
return (Math.random()<.5)?'left':'right'; | |
} | |
console.log(getRandomDirection()); | |
console.log(getRandomDirection()); | |
console.log(getRandomDirection()); |