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
#!/bin/bash | |
pm2 stop angular4 | |
. ~/.nvm/nvm.sh | |
nvm use 9.7.1 | |
npm install | |
pm2 start start.sh --name angular4 |
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
pragma solidity ^0.4.4; | |
import './Ownable.sol'; | |
contract EscrowContract is Ownable { | |
address public owner; | |
address public recipientAddress; | |
address public parent; | |
uint public escrowAmount; | |
EscrowStatuses public status = EscrowStatuses.Pending; | |
enum EscrowStatuses { Paid, Pending, Complete, Cancelled, Partial } |
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
pragma solidity ^0.4.4; | |
contract HelloWorld { | |
address public owner; | |
string public message; | |
function HelloWorld() { | |
owner = msg.sender; | |
message = 'Hello, world'; | |
} |
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
#!/bin/bash | |
#Force file syncronization and lock writes | |
mongo -u "username" -p "password" --authenticationDatabase "admin" --eval "printjson(db.fsyncLock())" | |
MONGODUMP_PATH="/usr/bin/mongodump" | |
MONGO_HOST="127.0.0.1" #replace with your server ip | |
MONGO_PORT="27017" | |
MONGO_DATABASE="dbname" #replace with your database name |
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 bitcore = require('bitcore'); | |
var assert = require('assert'); | |
var index = 1; | |
// Create a new HD private key. | |
var hdPrivateKey = new bitcore.HDPrivateKey(); //returns xpriv... | |
//Use private key to create drived public key. | |
var hdPublicKey = hdPrivateKey.hdPublicKey; | |
// Derive address from public key |
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
import { random, delay } from 'lodash'; | |
export const interval = (fn) => { | |
fn(); | |
delay(() => { interval(fn); }, randomNumber()); | |
}; | |
var randomNumber = () => { | |
return random(1000, 10000) | |
}; |
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 tests = [234534534234]; | |
tests.forEach(function (t) { | |
Test(t); | |
}); | |
function Test(N) { | |
var bin = N.toString(2); | |
var b = 0; | |
var col = bin.split("1").filter(function (val) { |
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
upstream app_www { | |
server 127.0.0.1:3000; | |
} | |
# the nginx server instance | |
server { | |
listen 80; | |
server_name www.www; | |
return 301 http://www.www.www; |
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
https://jsfiddle.net/3L140cg3/16/ |
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
FOR /f "tokens=*" %i IN ('docker-machine env --shell cmd default') DO %i | |
# Install | |
docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=password -d mysql:tag | |
# Go to bash | |
docker exec -it some-mysql bash | |
# mysql |