Skip to content

Instantly share code, notes, and snippets.

View ylv-io's full-sized avatar
🤑
Building Internet Money

Igor Yalovoy ylv-io

🤑
Building Internet Money
View GitHub Profile
function withdraw(address token, uint256 amount) returns (bool success) {
if (safeSub(block.number, lastActiveTransaction[msg.sender]) < inactivityReleasePeriod) throw;
...
}
function buildPatternTable(pattern) {
const fault = Array(pattern.length).fill(0);
let j = 0;
let i = 1;
while (i < pattern.length || j !== 0) {
if (pattern[i] === pattern[j]) {
fault[i] = j + 1;
j++;
} else if (j > 0) {
j = fault[j - 1];
var appInsights = window.appInsights;
if (appInsights && appInsights.queue) {
function adjustPageName(item) {
var name = item.name.replace("AppName", "");
if (name.indexOf("Order") !== -1)
return "Order";
if (name.indexOf("Product") !== -1)
var result = (function(a) {
return a*a;
}(5.5));
console.log(result);
const b = [1, 2, 3];
const f = (a, ...b) => a + b;
console.log(f(1));
let f = (...f) => f;
console.log(f(10));
f = (...f) => f.reduce(f => f);
console.log(f(10));
function ff() {
return arguments;
}
console.log(ff(10));
var foo = 10;
bar = 3;
(function () {
var foo = 2;
bar = 1;
}())
bar = bar + foo;
console.log(bar);
var x = 5;
(function () {
console.log(x);
var x = 10;
console.log(x);
})();
var x = 5;
(function () {
var x;
console.log(x);
x = 10;
console.log(x);
})();
(function(){
var a = b = 3;
})();
console.log(typeof a);
console.log(typeof b);