I hereby claim:
- I am barnabee on github.
- I am barnabee (https://keybase.io/barnabee) on keybase.
- I have a public key whose fingerprint is 75B6 19EC 7EDA 6EE1 C4B1 81A3 1D09 A19C 9CD3 A099
To claim this, I am signing this object:
import java.util.Comparator; | |
import java.util.regex.Matcher; | |
import java.util.regex.Pattern; | |
public class NumberAwareStringComparator implements Comparator<String> { | |
private static final Pattern splitter = Pattern.compile("([-]?[\\d]+(?:\\.[\\d]+)?|[\\D]+)"); | |
private static final Pattern matchNumber = Pattern.compile("[-]?\\d+(?:\\.[\\d]+)?"); | |
@Override |
var _ = require('underscore') | |
var Leap = require('leapjs') | |
/*** Decompose X, Y, Z vector to simple direction */ | |
var getDirection = function(vector) { | |
// Only do this if vector is defined and has length 3 | |
if (vector && vector.length == 3) { |
/** | |
** Example for creating curryable functions | |
**/ | |
// Helper to splice together 2 arrays, like arr.concat() except elements in 'arr1' containig 'empty' | |
// are first "filled" with elements from arr2. | |
// e.g. splice(['a', undefined, 'b'], ['c', 'd', 'e']) --> ['a', 'c', 'b', 'd', 'e'] | |
var splice = function (arr1, arr2, empty) { | |
var arr2_ = Array.prototype.slice.call(arr2, 0), // so this works with arguments objects | |
result = Array.prototype.slice.call(arr1, 0); |
To install MongoDB: "Autoparts" menu then "Manage Packages", search for MongoDB then | |
click "Install" then when done click "Start". | |
To install Express, in the console type: | |
npm install express -g<ENTER> | |
To create a new app. with folder structure ready to go, in the console type the following: | |
express ~/APPNAME --ejs<ENTER> | |
cd ~/APPNAME<ENTER> | |
npm install<ENTER> |
bair:~ barnaby$ telnet google.com 80 | |
Trying 173.194.116.137... | |
Connected to google.com. | |
Escape character is '^]'. | |
GET / | |
HTTP/1.0 302 Found | |
Location: http://www.google.co.uk/?gws_rd=cr&ei=f3ALU8aeIoeM4wTnl4HQDg | |
Cache-Control: private | |
Content-Type: text/html; charset=UTF-8 |
I hereby claim:
To claim this, I am signing this object:
#### Python should have indent-based alternatives to wrapping in all types of bracket | |
# | |
# Benefits: | |
# - indentation means no brackets to match n levels deep | |
# - new lines can replace commas, easy to reorder | |
# - feels nice and Pythony, works with the rest of the syntax | |
# - looks much cleaner and more readable without closing brackets and commas | |
# | |
# Instead of this |
from datetime import datetime, timedelta | |
import math | |
import widgets as wd | |
import datetime as dt | |
import requests | |
VEGA_TOKEN_ASSET_ID = 'd1984e3d365faa05bcafbe41f50f90e3663ee7c0da22bb1e24b164e9532691b2' | |
# PAYOUT_DELAY_NETPARAM = 'reward.staking.delegation.payoutDelay' | |
PAYOUT_PER_EPOCH_NETPARAM = 'reward.staking.delegation.maxPayoutPerEpoch' |
import time | |
import hmac | |
import hashlib | |
import requests | |
import base64 | |
class CoinbaseAuth(requests.auth.AuthBase): | |
def __init__(self, api_key, secret_key, api_passphrase): | |
self.api_key = api_key |
inherits = "jellybeans" | |
"ui.background" = {} |