This file contains 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
// | |
// 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 |
This file contains 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
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. | |
*/ |
This file contains 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 UIKit | |
import XCPlayground | |
import CoreGraphics | |
import PlaygroundSupport | |
/* | |
* Demo | |
*/ | |
func applyPerspective(_ view: UIView, distance: CGFloat) { | |
view.layer.transform.m34 = 1.0 / distance |
This file contains 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
// | |
// 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 |
This file contains 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
struct Mark { | |
float speed; | |
float acceleration; | |
uint16_t duration; | |
}; | |
Mark marks[] = { | |
{100.0, 100, 300}, | |
{60.0, 100, 100}, | |
{60.0, 100, 100}, |
This file contains 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
#! /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 |
This file contains 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
(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', | |
} |
OlderNewer