Skip to content

Instantly share code, notes, and snippets.

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

hpsaturn

🏠
Working from home
View GitHub Profile
@hpsaturn
hpsaturn / MailGunBasicSendMail.java
Last active April 2, 2020 17:10
Send Mail basic implementation via MailGun API and Retrofit for Android
import android.util.Base64;
import com.google.gson.Gson;
import com.hpsaturn.robotsanta.Config;
import com.hpsaturn.robotsanta.models.MailGunResponse;
import retrofit.Callback;
import retrofit.RestAdapter;
import retrofit.converter.GsonConverter;
import retrofit.http.Field;
@hpsaturn
hpsaturn / connect
Last active May 13, 2022 01:03
Bash wireless connect
#! /bin/sh
###################################################################
# WPA Connect
# 2009-2015 Hpsaturn v1.3
# [email protected]
#
# Archivos de configuracion:
# deben ser creados con wpa_passphrase en $CPATH previamente
# y deben tener de prefijo: wpa_ y sufijo .conf, por ej:
# wpa_casa.conf
#!/bin/sh
###################################################################
# Load hotspot
# 2009-2010 Hpsaturn v1.0
# [email protected]
#
# REV000: Creación de funciones iniciales. Mode Ad-Hoc soportado
###################################################################
DEVICE=wlan0
#include <unistd.h>
#include <iostream>
#include <sys/types.h>
#include <ifaddrs.h>
#include <netinet/in.h>
#include <string.h>
#include <cstring>
#include <arpa/inet.h>
#include "../cpp/driver/everloop_image.h"
"syntax on
"colorscheme murphy
set nocompatible " Use Vim defaults (much better!)
set bs=2 " Allow backspacing over everything in insert mode
set autoindent " Always set auto-indenting on
set smartindent
set ruler " Add bar information
set backup " Keep a backup file
set backupdir=$HOME/vimbackups
@hpsaturn
hpsaturn / Pressure.java
Created December 21, 2016 17:43
Google Things parser
public class Pressure extends SensorBase {
private static final String TAG = Pressure.class.getSimpleName();
private static final boolean DEBUG = Config.DEBUG;
private float altitude;
private float pressure;
private float temperature;
public Pressure(Wishbone wb) {
@hpsaturn
hpsaturn / asoundrc
Last active October 5, 2017 04:39
MATRIX Creator software installation and ALSA config for mic 0. (For Alexa Amazon service)
pcm.!default
{
type asym
playback.pcm {
type hw
card 0
device 0
}
capture.pcm {
type file
import zmq
import time
import driver_pb2 as driver_proto
creator_ip = '127.0.0.1' # or local ip of MATRIX creator
creator_gpio_base_port = 20013 + 36
context = zmq.Context()
socket = context.socket(zmq.PUSH)
#!/usr/bin/env sh
set -e
if [ -z "$NDK_ROOT" ] && [ "$#" -eq 0 ]; then
echo 'Either $NDK_ROOT should be set or provided as argument'
echo "e.g., 'export NDK_ROOT=/path/to/ndk' or"
echo " '${0} /path/to/ndk'"
exit 1
else
NDK_ROOT="${1:-${NDK_ROOT}}"
#!/usr/bin/env sh
set -e
if [ -z "$NDK_ROOT" ] && [ "$#" -eq 0 ]; then
echo 'Either $NDK_ROOT should be set or provided as argument'
echo "e.g., 'export NDK_ROOT=/path/to/ndk' or"
echo " '${0} /path/to/ndk'"
exit 1
else
NDK_ROOT="${1:-${NDK_ROOT}}"