Skip to content

Instantly share code, notes, and snippets.

View ivanseidel's full-sized avatar
undefined is not defined

Ivan Seidel ivanseidel

undefined is not defined
View GitHub Profile
@ivanseidel
ivanseidel / index.js
Created May 1, 2019 18:06
RD Station Country/State filler
(async function fillLocation() {
const regions = {
'acre': 'AC','alagoas': 'AL','amapa': 'AP','amazonas': 'AM','bahia': 'BA',
'ceara': 'CE','distrito federal': 'DF','espirito santo': 'ES','goias': 'GO',
'maranhao': 'MA','mato grosso': 'MT','mato grosso do sul': 'MS','minas gerais':
'MG','para': 'PA)','paraiba': 'PB','parana': 'PR','pernambuco': 'PE',
'piaui': 'PI','rio de janeiro': 'RJ','rio grande do norte': 'RN',
'rio grande do sul': 'RS','rondonia': 'RO','roraima': 'RR','santa catarina': 'SC',
'sao paulo': 'SP','sergipe': 'SE','tocantins': 'TO',
}
@ivanseidel
ivanseidel / startup-script.sh
Last active July 12, 2017 00:59
startup-script.sh
#! /bin/bash
echo User: $USER
/usr/share/google/dockercfg_update.sh
# Make sure container is stopped
docker stop tendaedu || true && /usr/bin/docker rm tendaedu || true
# Download ENV_LIST metadata and stores locally
curl "http://metadata.google.internal/computeMetadata/v1/project/attributes/ENV_LIST" -H "Metadata-Flavor: Google" -o list.env
@ivanseidel
ivanseidel / LineFollower.cpp
Created July 8, 2017 01:51
Mark based Line Following algorithm
struct Mark {
float speed;
float acceleration;
uint16_t duration;
};
Mark marks[] = {
{100.0, 100, 300},
{60.0, 100, 100},
{60.0, 100, 100},
//
// Created by Ivan Seidel
// A Led-Strip Light controller using a single button to control on/off and dimmer
//
#include <Adafruit_NeoPixel.h>
#define LEDS D2
#define BTN D1
@ivanseidel
ivanseidel / 3DFlip.swift
Last active May 7, 2017 03:05
TDC Florianopolis 2017 - Demos
import UIKit
import XCPlayground
import CoreGraphics
import PlaygroundSupport
/*
* Demo
*/
func applyPerspective(_ view: UIView, distance: CGFloat) {
view.layer.transform.m34 = 1.0 / distance
@ivanseidel
ivanseidel / restart.js
Created March 9, 2017 14:00
DraftLog cool examples
const async = require('async')
const chalk = require('chalk')
const TAG = chalk.green('[PM2]')
require('draftlog').into(console)
/*
* Statuses is an array of each server status.
*/
@ivanseidel
ivanseidel / test.js
Last active February 18, 2017 13:47
Redux's benchmarks
//
// Created by Ivan Seidel, Feb/2017
//
// This is a efficiency comparision on state manipulation of arrays
// using ~push~ and ~spread~ operator.
//
// Reason why I did this:
// while getting in sync with current JS/Nodejs tools around the web,
// I got myself digging into Redux's example codes and good practices.
// One of those, was to always use pure functions. Always re-create
@ivanseidel
ivanseidel / JohnnyWithDrive.js
Last active August 9, 2016 18:10
Sends data to Google Drive with Johnny-five and request
var five = require('johnny-five');
var request = require('request');
var url = 'https://script.google.com/macros/s/YOUR-APP-ID-HERE/exec';
var board = new five.Board();
board.on("ready", function() {
var sensor = new five.Pin("A0");
// Faz leitura unica e loga o valor
@ivanseidel
ivanseidel / Scripts.md
Last active March 24, 2017 19:32
Tournamenter Stuff

Startup:

node app --port=8090 --adapter.module sails-mongo --adapter.url mongodb://localhost:27017/obr_sp --backup.interval 10 --backup.path ~/Backups/ --backup.prefix obr_sp_ --env.NAME obr_sp --env.APP_NAME "OBR SP"

OBR Filtering Script Pre-2015 (Best 2 with Time configuration):

        var sum = 0;
	var timeSum = 0;
	var minScore = 9999;
@ivanseidel
ivanseidel / robotSimulationHit.pde
Created April 17, 2015 21:10
Processing Robot Hit Simulator
interface QuandoPrecisaExecutar{
public void executar(Robo eeew);
}
// http://bit.ly/1FSZBkP
class Robo{
Vetor position;
Vetor direction;