This file contains 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 GLib = imports.gi.GLib; | |
const Lang = imports.lang; | |
const System = imports.system; | |
let _breakpoints = 0; | |
function _getCurrentStack() { | |
try { | |
throw new Error(); | |
} catch (e) { |
This file contains 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
app.factory('NormalizedPosts', function($firebaseArray, userCache) { | |
var PostsWithUsers = $firebaseArray.$extend({ | |
// override $$added to include users | |
$$added: function(snap) { | |
// call the super method | |
var record = $firebaseArray.prototype.$$added.call(this, snap); | |
userCache.$load( record.user ).$loaded(function( userData ) { | |
record.userData = userData; | |
}); |
This file contains 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
define([ | |
'module/bootstrap', // this is jQuery and PubSub libs | |
], function (lib) { | |
var windowMock = { | |
resizeSet: false, // set within the fake `lib` object below | |
createFakeWindow: function(width, height) { | |
return { | |
document: { | |
documentElement: { |
This file contains 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
// SPDX-License-Identifier: GPL-3.0-or-later | |
pragma solidity >=0.8.4; | |
/// @notice Simple gas-optimized multi-signature contract. | |
contract Multisig { | |
event Propose(address indexed proposer, uint256 indexed proposal); | |
event Sign(address indexed signer, uint256 indexed proposal); | |
event Execute(uint256 indexed proposal); |
This file contains 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
// SPDX-License-Identifier: GPL-3.0-or-later | |
pragma solidity >=0.8.4; | |
/// @notice Simple gas-optimized multi-signature contract. | |
contract Multisig { | |
event Propose(address indexed proposer, uint256 indexed proposal); | |
event Sign(address indexed signer, uint256 indexed proposal); | |
event Execute(uint256 indexed proposal); | |
error NotSigner(); |
This file contains 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
First install pip for Python2. Download the get-pip.py file from https://bootstrap.pypa.io/get-pip.py | |
$ cd <download location> | |
$ sudo -H python ./get-pip.py | |
Installing pip also installs Python3 | |
To run Python3 | |
$ python3 | |
Install pip3 by just executing the same file as in the step above, but this time using Python3 | |
$ sudo -H python3 ./get-pip.py |
This file contains 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 fs = require("fs"); | |
const solc = require('solc') | |
let Web3 = require('web3'); | |
let web3 = new Web3(); | |
web3.setProvider(new web3.providers.HttpProvider('http://localhost:8545')); | |
var input = { | |
'strings.sol': fs.readFileSync('strings.sol', 'utf8'), | |
'StringLib.sol': fs.readFileSync('StringLib.sol', 'utf8'), |
This file contains 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 GLib = imports.gi.GLib; | |
const Gio = imports.gi.Gio; | |
let [res, out, err, status] = GLib.spawn_command_line_sync('ls -la'); | |
print(out); | |
let [res, out] = GLib.spawn_command_line_sync('ls -la'); | |
print(out); | |
let [res, out] = GLib.spawn_sync(null, ['/bin/ls', '-la'], null, 0, null); |
This file contains 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
contract random { | |
/* Generates a random number from 0 to 100 based on the last block hash */ | |
function randomGen(uint seed) constant returns (uint randomNumber) { | |
return(uint(sha3(block.blockhash(block.number-1), seed ))%100); | |
} | |
/* generates a number from 0 to 2^n based on the last n blocks */ | |
function multiBlockRandomGen(uint seed, uint size) constant returns (uint randomNumber) { | |
uint n = 0; | |
for (uint i = 0; i < size; i++){ |
OlderNewer