C02STG51GTFM:localstack mpandit$ make infra
. .venv/bin/activate; exec localstack/mock/infra.py
Starting local dev environment. CTRL-C to quit.
Starting local Elasticsearch (port 4571)...
Starting mock ES service (port 4578)...
Starting mock S3 server (port 4572)...
Starting mock SNS server (port 4575)...
pragma solidity ^0.4.18; | |
import './ERC20Basic.sol'; | |
import './SafeMath.sol'; | |
/** | |
* @title Basic token | |
* @dev Basic version of StandardToken, with no allowances. | |
* https://github.com/OpenZeppelin/zeppelin-solidity/ | |
*/ |
0x00 0 STOP | |
0x01 3 ADD | |
0x02 5 MUL | |
0x03 3 SUB | |
0x04 5 DIV | |
0x05 5 SDIV | |
0x06 5 MOD | |
0x07 5 SMOD | |
0x08 8 ADDMOD | |
0x09 8 MULMOD |
coins = 0.00 # just to initialize. | |
price = 1.00 # the price Filecoin states is the minimum | |
amount_raised = 52000000.00 # they've said they already sold $52M in the presale | |
total_filecoin_sold = 85000000.00 # the number of Filecoins already sold in the presale. This would be $52M/price (price was $0.75 and investors could choose up to 30% discount. I'm using 85M coins as an assumption (min 69M max 99M). | |
average_investment = 100000.00 # I'm already being generous here | |
while total_filecoin_sold < (200000000.00 - coins) do # 200M is the max amount of coins | |
price = amount_raised/40000000.00 # this is their function, it's always more than $1 | |
price = price * 0.9 # if you want to model an average discount people will choose | |
coins = average_investment / price # the amount of coins you get with every investment | |
amount_raised = amount_raised + average_investment # let's add the investment to the total raised |
pragma solidity ^0.4.11; | |
/** | |
* @title SafeMath | |
* @dev Math operations with safety checks that throw on error | |
*/ | |
library SafeMath { | |
function mul(uint256 a, uint256 b) internal returns (uint256) { | |
uint256 c = a * b; |
version: "3" | |
services: | |
snipeit: | |
env_file: ./snipe-it.env | |
image: snipe/snipe-it | |
depends_on: | |
- mysql | |
ports: | |
- "80:80" | |
volumes: |
--- | |
AWSTemplateFormatVersion: '2010-09-09' | |
Description: 'Cloudformation stack to manage permission to deploy a serverless service' | |
Parameters: | |
ServiceName: | |
Description: Name of the Service you want to deploy | |
Type: String | |
Resources: |
version: '3' | |
services: | |
wordpress: | |
image: wordpress:latest | |
ports: | |
- 8080:80 | |
- 8084:443 | |
volumes: | |
- ./data:/data | |
- ./src:/var/www/html |
Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.
In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.
Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j
#!/usr/bin/env bash | |
set -e | |
pycfiles=($(find . -name "*.pyc")) | |
for i in "${pycfiles[@]}"; do | |
pyfile="${i%.pyc}.py" | |
if [ ! -e "$pyfile" ]; then | |
echo "Removing "$i" because source file ("$pyfile") doesn't exist." | |
rm $i | |
fi | |
done |