Skip to content

Instantly share code, notes, and snippets.

View gerswin's full-sized avatar
🎯
Focusing

gerswin gerswin

🎯
Focusing
View GitHub Profile
homeassistant:
# Name of the location where Home Assistant is running
name: Home
# Location required to calculate the time the sun rises and sets
latitude: 5.4927
longitude: -73.4854
# Impacts weather/sunrise data (altitude above sea level in meters)
elevation: 0
# metric for Metric, imperial for Imperial
unit_system: metric
"""
Support for command line covers.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/cover.command_line/
"""
import logging
import subprocess
import voluptuous as vol
@gerswin
gerswin / sonoff.py
Last active April 13, 2019 07:21
sonoff custom component
# how to use
#light:
# - platform: sonoff
# host: "hassio ip"
# port: "1080"
import logging
import voluptuous as vol
/******************************************************************************
TestRun.ino
TB6612FNG H-Bridge Motor Driver Example code
Michelle @ SparkFun Electronics
8/20/16
https://github.com/sparkfun/SparkFun_TB6612FNG_Arduino_Library
Uses 2 motors to show examples of the functions in the library. This causes
a robot to do a little 'jig'. Each movement has an equal and opposite movement
so assuming your motors are balanced the bot should end up at the same place it
import React from 'react';
import { Button, Image, View } from 'react-native';
import { ImagePicker } from 'expo';
export default class ImagePickerExample extends React.Component {
state = {
image: [],
};
render() {
from socketIO_client import SocketIO, LoggingNamespace
import pygame
import urllib
import subprocess
import glob
import os
#v5
def play(audio_file_path):
subprocess.call(["ffplay", "-nodisp", "-autoexit", audio_file_path])
@gerswin
gerswin / exito.js
Last active September 14, 2016 18:36
bolivares y usd en exito.com
// ==UserScript==
// @name Exito Price
// @namespace http://tampermonkey.net/
// @version 0.4
// @description bolivares y dolares en exito.com
// @author gerswin
// @require http://code.jquery.com/jquery-latest.js
// @match http://www.exito.com/*
// @grant none
// ==/UserScript==
@gerswin
gerswin / servers.sh
Last active December 15, 2015 20:17
ubuntu servers
#!/bin/bash
# This script is used for create virtual hosts on CentOs.
# Created by alexnogard from http://alexnogard.com
# Improved by mattmezza from http://you.canmakethat.com
# Improved for Ubuntu by gerswin from http://gerswin.com
# Feel free to modify it
# PARAMETERS
#
# $usr - User
@gerswin
gerswin / getdata.php
Created December 4, 2015 18:21
productos y categorias mlv
$categories = [];
$count = count($it);
for ($i = 0; $i < $count ; $i++) {
$item = $meli->get("/items/" . $it[$i]);
$category = $meli->get("/categories/" . $item['body']->category_id);
$cats = [];
try {
foreach ($category['body']->path_from_root as $value) {
$cats[] = $value->id;
$categories[$value->id] = ["ml_id" => $value->id, "name" => $value->name];
@gerswin
gerswin / app.js
Created November 2, 2015 16:11 — forked from velsa/app.js
Express server used to launch ffmpeg, transcode stream from peerflix and serve it to HTML5 video tag
var express = require('express'),
http = require('http'),
path = require('path'),
child_process = require("child_process");
var app = express();
// Server settings
app.set('port', process.env.PORT || 9999);
app.use(express.favicon());