The only cross-platform browser that fits in a Gist!
One line install. Works on Linux, MacOSX and Windows.
$> npm install http://gist.github.com/morganrallen/f07f59802884bcdcad4a/download
var CryptoJS = require("crypto-js"); | |
function pad(number) { | |
if (number<=999) { number = ("00"+number).slice(-3); } | |
return number; | |
} | |
var timestamp = (Math.floor(new Date() / 1000)) + "." + pad(new Date() % 1000); | |
var deviceId = "8A6A3699-1527-4E52-8441-7AA9AAD529F4"; | |
var path = "/v2/authorizationservice/shopperauth"; |
function elcreate (tag, styles = {}, attrs = {}, children=[]) { | |
let el = document.createElement(tag); | |
Object.keys(styles).forEach((item) => { | |
el.style[item] = styles[item]; | |
}); | |
Object.keys(attrs).forEach((item) => { | |
el[item] = attrs[item]; | |
}); |
// safely get object prop, like lodash get but without any dependencies | |
// specify path as dot delimited string | |
// optionally provide default value | |
function get(obj, path, def) { | |
path = path.split('.'); | |
let ret = obj || {}; | |
path.forEach((item) => { | |
ret = ret && ret[item]; | |
}); | |
return ret || def; |
;system settings | |
$ja 2000000 | |
$st 1 | |
$mt 10 | |
; motor1 | |
$1ma 0 | |
$1sa 1.8 | |
$1tr 40.00 | |
$1mi 8 |
<?xml version="1.0"?> | |
<root> | |
<item> | |
<name>PC Application Key to Extra1 Modifier</name> | |
<identifier>private.pc_application_to_extra1</identifier> | |
<autogen>--KeyToKey-- KeyCode::PC_APPLICATION, KeyCode::VK_MODIFIER_EXTRA1</autogen> | |
</item> | |
<item> | |
<name>Extra1+J to CURSOR_DOWN</name> |
print "importing local customizations" | |
print "_list_helpers() to list defined functions" | |
# TODO: guard this somehow so if we fire up the | |
# normal python interpreter we don't see an error | |
from django.db import transaction | |
@transaction.commit_manually | |
def flush_transaction(): | |
""" |
# omitting a comma after the second field | |
# does not generate an error | |
fields = [ | |
'field1', | |
'field2' | |
'field3' | |
] | |
# in fact | |
'field1' 'field2' == 'field1field2' |
#include <LiquidCrystal.h> | |
LiquidCrystal lcd(12, 11, 5, 4, 3, 2); | |
int offset = 0; | |
int sinetable[32]; | |
// Precomputed sine table taken from somewhere... | |
// can't find it now | |
void setupSintable() { | |
sinetable[0] = 127; |
public BusinessEntityCollection RetrieveMultiple( Microsoft.Crm.Sdk.Query.QueryBase query ) { | |
QueryExpression queryExpression = ( QueryExpression )query; | |
BusinessEntityCollection retval = new BusinessEntityCollection(); | |
if( data.ContainsKey( query.EntityName ) ) { | |
foreach( BusinessEntity entity in data[ query.EntityName ] ) { | |
if( true == EvaluateFilters( queryExpression.Criteria, entity ) ) { | |
retval.BusinessEntities.Add( entity ); | |
} | |
} | |
} |