Skip to content

Instantly share code, notes, and snippets.

View Horaddrim's full-sized avatar
👽
Seeking knowledge...

Horaddrim Horaddrim

👽
Seeking knowledge...
  • C-137
View GitHub Profile
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) {
package main
import (
"fmt"
"os"
"os/exec"
"syscall"
)
// docker run <container> cmd args
package main
// Importamos os pacotes
import (
"fmt"
"os"
"os/exec"
"syscall"
)
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
pragma solidity ^0.4.19;
contract ZombieFactory {
event NewZombie(uint zombieId, string name, uint dna);
uint dnaDigits = 16;
uint dnaModulus = 10 ** dnaDigits;
struct Zombie {
Desktop/estudos/git-study on  master
➜ tree .git
.git
├── branches
├── config
├── description
├── HEAD
├── hooks
│   ├── applypatch-msg.sample
│   ├── commit-msg.sample
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}`);
for containerId in `sudo docker ps -a | awk '{print $1}'`
do
echo ${containerId}
sudo docker rm $containerId
done
echo 'All cleaned pawn! :D'
for containerId in `sudo docker-compose ps -q'`
do
echo ${containerId}
sudo docker-compose rm $containerId
done
echo 'All cleaned pawn! :D'
# 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