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
| package main | |
| // Actor ... Defines an actor, that have always to have a flow to "act" and a | |
| // key to manage the "action" | |
| type Actor struct { | |
| isAvailable bool | |
| flow chan int | |
| } | |
| func (actor *Actor) subscribe(c chan int) { |
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
| package main | |
| import ( | |
| "fmt" | |
| "os" | |
| "os/exec" | |
| "syscall" | |
| ) | |
| // docker run <container> cmd args |
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
| package main | |
| // Importamos os pacotes | |
| import ( | |
| "fmt" | |
| "os" | |
| "os/exec" | |
| "syscall" | |
| ) |
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
| let length = array.length - 1 | |
| // Simple processing inside | |
| for (let i = length; i >=0; i--){ | |
| console.log(array[i]) | |
| } | |
| // For promises and hard-stuff | |
| let length = array.length - 1 |
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.19; | |
| contract ZombieFactory { | |
| event NewZombie(uint zombieId, string name, uint dna); | |
| uint dnaDigits = 16; | |
| uint dnaModulus = 10 ** dnaDigits; | |
| struct Zombie { |
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
| Desktop/estudos/git-study on master | |
| ➜ tree .git | |
| .git | |
| ├── branches | |
| ├── config | |
| ├── description | |
| ├── HEAD | |
| ├── hooks | |
| │ ├── applypatch-msg.sample | |
| │ ├── commit-msg.sample |
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
| server.ext('onRequest', (req: Hapi.Request, reply: any) => { | |
| const chalk = Chalk.default; | |
| let route = ''; | |
| let method = ''; | |
| switch (req.raw.req.method) { | |
| case 'GET': | |
| method = chalk.blue(`${req.raw.req.method}`); | |
| route = chalk.bgBlue(`${req.raw.req.url}`); |
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 containerId in `sudo docker ps -a | awk '{print $1}'` | |
| do | |
| echo ${containerId} | |
| sudo docker rm $containerId | |
| done | |
| echo 'All cleaned pawn! :D' |
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 containerId in `sudo docker-compose ps -q'` | |
| do | |
| echo ${containerId} | |
| sudo docker-compose rm $containerId | |
| done | |
| echo 'All cleaned pawn! :D' |
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 from this wonderful lib the constant equals to the Jupiter Mass (in KG) | |
| from astropy.constants import M_jup | |
| # if you don't want the library | |
| # M_jup = 10**27 | |
| def mj_to_kg(mj_value): | |
| raw_value = int(mj_value) | |
| return (raw_value + 0.00019) * M_jup | |