Skip to content

Instantly share code, notes, and snippets.

View xjunior's full-sized avatar
🏠
Working from home

Carlos Palhares xjunior

🏠
Working from home
View GitHub Profile
@xjunior
xjunior / Crivo de Eratóstenes
Created April 11, 2011 19:36
Sieve of Eratosthenes is an algorithm to find prime numbers from 2 to a given number.
## Code
module Crivo
def self.gera_primos(til)
list = (2..til).to_a
list.each do |pivot|
list = remove_multiples(list, pivot)
end
list
end
@xjunior
xjunior / robot.js
Created December 8, 2012 14:13
LastScene
var Robot = function(robot) {
robot.ahead(100);
};
Robot.prototype.onIdle = function(ev) {
var self = ev.robot;
this.cloneIfPossible(self);
this.shootAsap(self);
self.turn(2);
self.ahead(10);
package main
import (
"fmt"
"time"
"sync"
)
func timedPrint(number int64, group *sync.WaitGroup) {
time.Sleep(time.Duration(number) * time.Millisecond)
$ compare-config -v app1 app1-staging
=== app1 Config Vars === app1-staging Config Vars
MMYSQL_DATABASE: mysql://staging-user:password@host.com MMYSQL_DATABASE: mysql://staging-user:password@host.com
FEATURE_ENABLED: false FEATURE_ENABLED: true
SERVICE_KEY_ID: AKI43DW4XFD16JONFE2Q SERVICE_KEY_ID: IKD9ON2T999KIAIDK1XA
SERVICE_ACCESS_KEY: DFS1PGC9eICquUZjiid9sKZC9123 SERVICE_ACCESS_KEY: DFSPGC9e4ICquUZjiid9sKZC9123
$ compare-config app1 app1-staging
=== app1 Config Vars === app1-staging Config Vars
MMYSQL_DATABASE MMYSQL_DATABASE
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
options=3<RXCSUM,TXCSUM>
inet6 ::1 prefixlen 128
inet 127.0.0.1 netmask 0xff000000
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
nd6 options=1<PERFORMNUD>
gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
stf0: flags=0<> mtu 1280
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether 14:10:9f:e1:4c:77
eth0 Link encap:Ethernet HWaddr 08:00:27:cb:ae:0d
inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fecb:ae0d/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:780 errors:0 dropped:0 overruns:0 frame:0
TX packets:1681 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:80354 (80.3 KB) TX bytes:229037 (229.0 KB)
eth1 Link encap:Ethernet HWaddr 08:00:27:b2:4d:ca
>>> Last Known Kubernetes Status...
NAME READY STATUS RESTARTS AGE
nitro-demo24-nitro-call-loop-78cd5d7d98-bbt9q 1/1 Running 0 22m
nitro-demo24-nitro-connect-server-66d57db4f4-r9skr 1/1 Running 0 22m
nitro-demo24-nitro-cron-747dbc59f4-cjw4t 1/1 Running 0 22m
nitro-demo24-nitro-resque-pool-64dcf97458-4jr8k 1/1 Running 0 22m
nitro-demo24-nitro-resque-scheduler-75fb4db7bf-xwkfq 1/1 Running 0 22m
nitro-demo24-nitro-resque-single-connect-notifications-696jnql9 0/1 Completed 7 22m
nitro-demo24-nitro-resque-single-connect-presence-6cdb8957nfln6 0/1 CrashLoopBackOff 7 22m
>>> Deploying CarlosPalhares-5bace22d909f44fc2efb8dccc426fc9b84357406-2018-06-22_154214 to demo24 (nitro-demos)
>>> Last Known Kubernetes Status...
NAME READY STATUS RESTARTS AGE
nitro-demo24-nitro-call-loop-db6b745d4-wbgp6 0/1 CreateContainerConfigError 0 10m
nitro-demo24-nitro-connect-server-6c666f8ccd-b4jxp 0/1 CreateContainerConfigError 0 9m
nitro-demo24-nitro-cron-687d77fb8b-xwcgc 0/1 CreateContainerConfigError 0 10m
nitro-demo24-nitro-resque-pool-74b786f5c8-zl9w9 0/1 CreateContainerConfigError 0 10m
nitro-demo24-nitro-resque-scheduler-9cf775c5f-pcznt 0/1 CreateContainerConfigError 0 9m
nitro-demo24-nitro-resque-single-connect-notifications-bc4kx9mb 0/1 CreateContainerConfigError 0 9m
nitro-demo24-nitro-resque-single-connec
image: docker:latest
services:
- docker:dind
variables:
BACKEND_IMAGE: 'rainbows-backend:$CI_COMMIT_SHA'
stages:
- frontend
00:00 git:wrapper
01 mkdir -p /tmp
✔ 01 dimadmin@demo21-nitro-webserver.mydatainmotion.com 2.418s
✔ 01 dimadmin@demo21-nitro-task.mydatainmotion.com 2.417s
Uploading /tmp/git-ssh-nitro-demo21-chjunior.sh 100.0%
Uploading /tmp/git-ssh-nitro-demo21-chjunior.sh 100.0%
02 chmod 700 /tmp/git-ssh-nitro-demo21-chjunior.sh
✔ 02 dimadmin@demo21-nitro-task.mydatainmotion.com 0.322s
✔ 02 dimadmin@demo21-nitro-webserver.mydatainmotion.com 0.323s