Skip to content

Instantly share code, notes, and snippets.

@labiak
labiak / RedBone.js
Created October 18, 2018 07:20 — forked from kissarat/RedBone.js
"use strict";
const DEBUG = !!+localStorage.get('DEBUG');
function base(self, parent) {
self.__proto__.__proto__ = parent;
}
function copy(a, b) {
if (b)
b = {};
@labiak
labiak / flattened.sol
Last active October 18, 2018 10:21 — forked from kissarat/flattened.sol
pragma solidity ^0.4.24;
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address _who) public view returns (uint256);
function transfer(address _to, uint256 _value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
const https = require('https')
const fs = require('fs')
const entites = ''
function fetch(path) {
return new Promise(function (resolve, reject) {
const req = https.request({
hostname: 'etherscan.io',
method: 'GET',
// const s = document.createElement('script'); s.src = 'https://cdn.rawgit.com/kissarat/b979c322bf3ced4c21009b60160b20fa/raw/identify.js'; document.body.appendChild(s);
function *$combine(...seq) {
for (let i = 1; i <= seq.length; i++) {
for (let j = 0; j <= seq.length - i; j++) {
yield seq.slice(j, j + i)
}
}
}
@labiak
labiak / proxy.js
Created November 1, 2018 23:32 — forked from kissarat/proxy.js
/**
* @author Taras Labiak <[email protected]>
*/
const http = require('http');
const https = require('https');
const fs = require('fs');
const path = require('path');
const {promisify} = require('util');
@labiak
labiak / postman.js
Last active November 3, 2018 14:55
This is a script for applying changes to base Postman import file. Use node merge-postman.js <source> <target> Where <source> - is a base JSON import file for applying changes And <target> - file with new request to add to <source> file
/**
* This is a script for applying changes to base Postman import file.
* Use
* node merge-postman.js <source> <target>
* Where <source> - is a base JSON import file for applying changes
* And <target> - file with new request to add to <source> file
* @author Taras Labiak <[email protected]>
* {@link https://indeema.com Indeema}
*/
const http = require('http');
const {getOptions, pretty} = require('./utilities');
const [{port = 1989, help = false, color = false}] = getOptions();
function report(...args) {
console.log('// ', ...args);
}
if (help) {
/^0x[\da-f]{40}$/i
{
"routes": [
{
"method": "GET",
"path": "/users/me",
"handler": "User.me",
"config": {
"policies": [],
"prefix": ""
}
{
"sid": "SM29f4f980778e4621b72df75ac82f5000",
"date_created": "Tue, 27 Nov 2018 16:14:39 +0000",
"date_updated": "Tue, 27 Nov 2018 16:14:39 +0000",
"date_sent": null,
"account_sid": "ACc4c268517530bb5fec0b659e3f88c6be",
"to": "+380671541943",
"from": "+19106000514",
"messaging_service_sid": null,
"body": "Hello",