Skip to content

Instantly share code, notes, and snippets.

@AlexisLeon
AlexisLeon / main.go
Created June 11, 2020 17:43 — forked from spksoft/main.go
Example Golang worker with rabbitMQ graceful shutdown
package main
import (
"flag"
"log"
"os"
"os/signal"
"syscall"
"time"
@AlexisLeon
AlexisLeon / send-sms.go
Created August 23, 2019 10:05 — forked from ivajloip/send-sms.go
Sending an SMS Text Message using AWS SNS service in GoLang
//assumes you have the following environment variables setup for AWS session creation
// AWS_SDK_LOAD_CONFIG=1
// AWS_ACCESS_KEY_ID=XXXXXXXXXX
// AWS_SECRET_ACCESS_KEY=XXXXXXXX
// AWS_DEFAULT_REGION=us-east-1
package main
import (
"fmt"
@AlexisLeon
AlexisLeon / react-native.js
Created April 16, 2018 05:19 — forked from lelandrichardson/react-native.js
React Native flow types
declare var __DEV__: boolean;
declare module 'react-native' {
declare type Color = string | number;
declare type Transform =
{ perspective: number } |
{ scale: number } |
{ scaleX: number } |
@AlexisLeon
AlexisLeon / react-native.js
Created April 16, 2018 05:19 — forked from lelandrichardson/react-native.js
React Native flow types
declare var __DEV__: boolean;
declare module 'react-native' {
declare type Color = string | number;
declare type Transform =
{ perspective: number } |
{ scale: number } |
{ scaleX: number } |
@AlexisLeon
AlexisLeon / dh-usage.js
Last active January 22, 2018 18:54 — forked from durango/dh-usage.js
[nodejs][javascript] Diffie-Hellman key exchange by nodejs-0.5
// node.js 0.5 Diffie-Hellman example
var assert = require("assert");
var crypto = require("crypto");
// the prime is shared by everyone
var server = crypto.createDiffieHellman(512);
var prime = server.getPrime();
// sharing secret key on a pair
@AlexisLeon
AlexisLeon / homebridge
Created July 18, 2017 00:08 — forked from johannrichard/homebridge
Systemd Service for homebridge (http://github.com/nfarina/homebridge)
# Defaults / Configuration options for homebridge
# The following settings tells homebridge where to find the config.json file and where to persist the data (i.e. pairing and others)
HOMEBRIDGE_OPTS=-U /var/lib/homebridge
# If you uncomment the following line, homebridge will log more
# You can display this via systemd's journalctl: journalctl -f -u homebridge
# DEBUG=*
@AlexisLeon
AlexisLeon / bluetooth_serial.md
Created July 17, 2017 23:55 — forked from 0/bluetooth_serial.md
Connecting a Bluetooth device for serial communication on Arch Linux.

The following are instructions for connecting a Bluetooth device for serial communication on Arch Linux using BlueZ 5.31.

Prerequisites

The following packages are required:

  • bluez: bluetoothd
  • bluez-utils: bluetoothctl, rfcomm
@AlexisLeon
AlexisLeon / README-Template.md
Created July 13, 2017 01:44 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@AlexisLeon
AlexisLeon / gist:46e5a997575a8523793d433aa54d58e2
Created April 10, 2017 23:38 — forked from mnylen/gist:8c4010ab353f4886f89c
Using the new Safari View Controller from React Native application

Using the new Safari View Controller from React Native application

  • Safari View Controller is iOS 9 only. You need Xcode 7 (beta 2 currently) to use it

  • React Native 0.6.0 is the minimum I got this working on

You might need to add this to your Info.plist in order for iOS 9 to load your application correctly:

<key>NSAppTransportSecurity</key>
@AlexisLeon
AlexisLeon / onesignal-node.js
Created April 6, 2017 06:03 — forked from mulhoon/onesignal-node.js
Send a push notification in node with OneSignal
var request = require('request');
var sendMessage = function(device, message){
var restKey = '****';
var appID = '****';
request(
{
method:'POST',
uri:'https://onesignal.com/api/v1/notifications',
headers: {