ACL defined in RFC 3744, section 8.1
BASELINE-CONTROL defined in RFC 3253, section 12.6.
BIND defined in RFC 5842, section 4
CHECKIN defined in RFC 3253, section 4.4 and section 9.4
CHECKOUT defined in RFC 3253, section 4.3 and section 8.8
# mongo export all users who have an email and are not hellbanned | |
# take special notice that --query is in quotes and is valid JSON | |
# also that --fields is also wrapped with quotes and is comma seperated | |
mongoexport --db appname --collection users \ | |
--query '{ "$and" : [ { "email" : { "$ne" : "" } }, { "role" : { "$ne" : 666 } } ] }' \ | |
--csv --fields 'username, email' --out ./user-emails.csv |
var unirest = require('unirest') | |
// This is the starting timestamp of when the request was sent | |
var requestSent = new Date().getTime() | |
unirest | |
.get('http://localhost:1337/') | |
.end(function(res){ | |
if (res.status === 200) { | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script> | |
<script src="https://cdn.rawgit.com/jeremyfa/yaml.js/develop/dist/yaml.min.js"></script> | |
<script src="https://cdn.rawgit.com/Fooidge/PleaseJS/master/dist/Please.js"></script> | |
<meta charset="utf-8"> | |
<style> | |
a { | |
font: 16px sans-serif; |
var os = require('os') | |
var response = {} | |
for (property in os) { | |
if (typeof os[property] === 'function') { | |
response[property] = os[property]() | |
} else { | |
response[property] = os[property] | |
} |
#!/usr/bin/env bash | |
# Ask for sudo up front | |
echo "Some steps require sudo so please enter your password" | |
sudo -v | |
# Check for and install developer tools | |
xcode-select -p | |
if [ $? -ne 0 ]; then | |
# Install dev tools |
console.log(fancyDate(556095600000)) | |
// August 16th, 1987 | |
function fancyDate(input) { | |
var input = new Date(input) | |
var monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"] | |
var monthName = monthNames[input.getMonth()] | |
var day = input.getDate() |
## MOVED REPOS: https://github.com/montanaflynn/palindromes ## | |
Learning exercise by writing the same program in multiple languages. The | |
time results below are the best out of ten runs, optimizations welcome! | |
Rust 0.12.0: 0.03s user 0.00s system 95% cpu 0.036 total | |
Clang 600.0.51: 0.04s user 0.00s system 96% cpu 0.039 total | |
GO 1.3.1: 0.11s user 0.01s system 101% cpu 0.112 total | |
Ruby 2.0.0: 0.15s user 0.01s system 99% cpu 0.154 total | |
Haskell 7.8.3: 0.20s user 0.01s system 99% cpu 0.211 total |
ACL defined in RFC 3744, section 8.1
BASELINE-CONTROL defined in RFC 3253, section 12.6.
BIND defined in RFC 5842, section 4
CHECKIN defined in RFC 3253, section 4.4 and section 9.4
CHECKOUT defined in RFC 3253, section 4.3 and section 8.8
package easyget | |
import ( | |
"io" | |
"io/ioutil" | |
"net/http" | |
) | |
// Define Request struct | |
type Request struct { |
// data format in JSON is just array of objects | |
var data = [{"a":5,"b":24},{"a":11,"b":72},{"a":20,"b":100},{"a":50,"b":257}] | |
// filter object key a > 10 | |
filtered = data.filter(function(datum){ | |
// returning true keeps the object in array | |
if (datum.a > 10) return true | |
}) |