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
class OrderIdentifierGenerator { | |
static characters = '234567CDFGHJKLMNPQRTVWXYZ'; | |
// Generate a new identifier | |
static generate() { | |
const partialIdentifier = OrderIdentifierGenerator.generatePartialIdentifier(); | |
let identifier = ( | |
partialIdentifier.slice(0, 3) + |
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 view = new View(); | |
view.width = 1024; | |
view.height = 768; | |
view.render(); |
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
Verifying my Blockstack ID is secured with the address 1KfdWMJuVKdLB2eCLXNxnkmU1TmdzC9rfM https://explorer.blockstack.org/address/1KfdWMJuVKdLB2eCLXNxnkmU1TmdzC9rfM |
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
<html> | |
<head> | |
<title>We need a way to wrap console.log and preserve the file and line number</title> | |
<script> | |
function customLog() { | |
var processedArguments = arguments; | |
// Do something with the arguments besides logging them, maybe format them or store them | |
// ... | |
// Send the output to Developer Tools |
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
implement = function(classToReceiveImplementation, classToImplement) { | |
for(var classToImplementProperty in classToImplement) { | |
if(classToReceiveImplementation[classToImplementProperty] === undefined) { | |
//console.log(classToImplementProperty, 'does not exist on class, copying'); | |
classToReceiveImplementation[classToImplementProperty] = cloneProperty(classToImplement[classToImplementProperty]); | |
} | |
} | |
for(var classToImplementPrototypeProperty in classToImplement.prototype) { | |
if(classToReceiveImplementation.prototype[classToImplementPrototypeProperty] === undefined) { |
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
<html> | |
<head> | |
<title>Overscrolling HTML Elements in Chromium on OS X using a Trackpad</title> | |
<style> | |
html { | |
font-family: sans-serif; | |
border: 4px solid #00AAFF; | |
} | |
</style> | |
</head> |
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
<html> | |
<head> | |
<style> | |
@-webkit-keyframes struck { | |
0% { -webkit-transform: translateX(10px); } | |
50% { -webkit-transform: translateX(0); } | |
100% { -webkit-transform: translateX(10px); } |
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
<?php | |
function asanaRequest($methodPath, $httpMethod = 'GET', $body = null) { | |
$apiKey = 'ASANA_API_KEY_HERE'; /// Get it from http://app.asana.com/-/account_api | |
$url = "https://app.asana.com/api/1.0/$methodPath"; | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, $url); | |
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC ) ; | |
curl_setopt($ch, CURLOPT_USERPWD, $apiKey); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 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
String.prototype.baconify = function() { | |
return this.replace(/({|})/gi, 'BACON'); | |
} | |
'{"jsonKey":"jsonValue"}'.baconify(); | |
//"BACON"jsonKey":"jsonValue"BACON" |
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
require('node.io').scrape(function() { | |
this.getHtml('http://www.reddit.com/', function(err, $) { | |
var stories = []; | |
$('.entry .title').each(function(title) { | |
stories.push(title.text); | |
}); | |
this.emit(stories); | |
}); | |
}); |
NewerOlder