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
/* directive.ionimagetitleview.js | |
This directive is a copy of ionView which allows you to set a title="<html can go here>" and real-title="Document <title> goes here". The purpose of this directive is to allow for HTML to be embedded in the header of an ion-view without having it printed as | |
the document title, instead substituting an actual title. | |
*/ | |
angular.module('ionic.imagetitleview', []).directive('ionImageTitleView', ['$ionicViewService', '$rootScope', '$animate', function ($ionicViewService, $rootScope, $animate) { | |
return { | |
restrict: 'EA', |
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
angular.module('soundManager', ['ui.router']).config(function ($stateProvider, $urlRouterProvider) { | |
$urlRouterProvider.otherwise('/main/nested'); | |
$stateProvider.state('main', { | |
url: '/main', | |
controller: function (sm) { // code with sm (sound manager) here }, | |
templateUrl: 'index.html', | |
resolve: { | |
sm: function (soundManager) { | |
return soundManager(); | |
} |
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 filter = web3.eth.filter({ address: web3.eth.accounts[0] }); | |
filter.watch(function () { | |
filter.stopWatching(); | |
callback(); | |
}); |
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
Program received signal SIGSEGV, Segmentation fault. | |
#0 0x00007ffff72d5853 in std::basic_ostream<char, std::char_traits<char> >& std::operator<< <char, std::char_traits<char>, std::allocator<char> >(std::basic_ostream<char, std::char_traits<char> >&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) () | |
from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | |
#1 0x00000000004becbf in boost::io::detail::put_last<char, std::char_traits<char>, std::string> (os=..., | |
x=<error reading variable: Cannot access memory at address 0xfeffffffffffffe9>) at /usr/local/include/boost/format/feed_args.hpp:114 | |
#2 0x00000000004bcbc6 in boost::io::detail::call_put_last<char, std::char_traits<char>, std::string> (os=..., x=0x7fffffffe0e0) | |
at /usr/local/include/boost/format/feed_args.hpp:126 | |
#3 0x00000000004c11e5 in boost::io::detail::put_last<char, std::char_traits<char> > (os=..., t=...) at /usr/local/include/boost/format/feed_args.hpp:149 | |
#4 0x00000000004bf169 in boost::io::detail::put<char, st |
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
function myFunc() { | |
if (!myFunc.static) myFunc.static = Object.create(null); | |
// now we can access this hash every time we call the function, export it along with the function, and it is purely associated with the function | |
if (!myFunc.static.x) myFunc.static.x = 0; | |
myFunc.static.x++; | |
return myFunc.static.x; | |
} | |
myFunc(); | |
myFunc(); |
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 log = console.log; | |
var assign = Object.assign; | |
var MyClass = (function () { | |
var state = new Map(); | |
function makeDefaultState() { | |
return { a: 0 }; | |
} | |
function getState() { | |
return state.get(this); | |
} |
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
const { create, assign } = Object, | |
{ dispatch, getState } = (function () { | |
let state = { | |
a: 5 | |
}; | |
const reduce = (last, action) => { | |
const { type, payload } = action; | |
switch (type) { | |
case 'INCREMENT_A': | |
return assign({ a: last.a + payload }, last); |
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
const { soliditySha3 } = require('web3-utils'); | |
const { | |
hashPersonalMessage, | |
bufferToHex, | |
toBuffer, | |
ecsign | |
} = require('ethereumjs-util') | |
const { mapValues } = require('lodash'); | |
const contractAddress = '0x2a0c0dbecc7e4d658f48e01e3fa353f44050c208'; |
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
[ | |
{ | |
"date": "2017-11-25 14:30:00", | |
"amount": "5168879.91350462", | |
"type": "buy", | |
"total": "0.004393547926478927", | |
"price": "0.00000000085", | |
"orderHash": "0x78b320a475ca58c17370c5de8850dbd5665358f2d3216f9e954dacb610198961", | |
"uuid": "1e799bb0-d1ed-11e7-ab09-d9e379eeee7a", | |
"buyerFee": "130337.759827009238855819", |
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
'use strict'; | |
const number = 100; | |
// see the actual bits, since JS uses 64-bit doubles | |
let buffer = new ArrayBuffer(8); | |
let doubleLoader = new Float64Array(buffer); | |
doubleLoader[0] = number; | |
let bytes = new Uint8Array(buffer); | |
// output the bytes | |
console.log([].slice.call(bytes)); |
OlderNewer