Skip to content

Instantly share code, notes, and snippets.

View spalladino's full-sized avatar
🔷

Santiago Palladino spalladino

🔷
View GitHub Profile
@spalladino
spalladino / verboice-user.sh
Created January 29, 2016 12:05
Manually change the password for the main user in a local installation of Verboice
# Go to Verboice main folder
cd verboice
# Open console
bundle exec rails c production
# Retrieve the first user
u = User.first
# This line should print the user's email, check that it is the one you expect
@spalladino
spalladino / brium-dbsetup-job.yaml
Created March 17, 2016 16:50
Kubernetes sample config files for running Brium web app with a MySQL service on Google Container Engine
apiVersion: extensions/v1beta1
kind: Job
metadata:
name: brium-dbsetup
spec:
selector:
matchLabels:
app: brium-dbsetup
template:
metadata:
@spalladino
spalladino / brium-bot.js
Created March 22, 2016 14:05
V1 of Brium bot using Howdy Botkit
var os = require('os');
var fs = require('fs');
var http = require('http');
http.post = require('http-post');
var _ = require('lodash');
var Botkit = require('botkit');
var briumUrl = 'http://brium.me';
var main = function(slackToken, briumToken) {
@spalladino
spalladino / app.js
Created April 1, 2016 17:49
Random placement of rectangles in a canvas based on minmax distance
HEIGHT = 800;
WIDTH = 1200;
CANDIDATES = 5;
INTERVAL = 1000;
var logos = [];
var tryPositionLogo = function(width, height) {
var candidate = null;
var candidateValue = null;
@spalladino
spalladino / send_aos.rb
Created April 21, 2016 18:54
Sends AOs in bulk to Nuntium
require "rubygems"
require "nuntium"
SERVER = ""
ACCOUNT = ""
APPLICATION = ""
PASSWORD = ""
COUNT = 1000
FROM = ""
@spalladino
spalladino / sample_manifest.xml
Created November 14, 2016 22:39
Sample Manifest
<?xml version="1.0" encoding="UTF-8" ?>
<verboice-service>
<name>Callback test</name>
<steps>
<step name="callback-test"
display-name="Callback test"
icon="medicalkit"
type="callback"
callback-url="http://requestb.in/y9fz04y9">
<settings>
@spalladino
spalladino / Makefile
Created November 23, 2016 15:40
Proof of concept of Ruby extension written in Crystal
testruby.bundle: testruby.cr
crystal testruby.cr --link-flags "-dynamic -bundle -Wl,-undefined,dynamic_lookup" -o testruby.bundle
irb: testruby.bundle
irb -rtestruby -I.
clean:
rm -rf .crystal testruby.bundle
@spalladino
spalladino / main.cr
Last active November 29, 2016 23:31
Alternative code for "Crystal in real life" post
# Adapted from http://pfertyk.me/2016/11/crystal-in-real-life/
require "stumpy_png"
canvas = StumpyPNG.read("image.png")
canvas.width.times do |x|
canvas.height.times do |y|
color = canvas[x, y]
@spalladino
spalladino / rinkeby.txt
Created September 8, 2017 14:56
Rinkeby test address
0x9D49a5aBBD1AD73aA7D0547e3Ec5B14ce640718E
@spalladino
spalladino / monitor.js
Created October 15, 2017 23:15
Configure ngrok with nodemon for local development
#!/usr/bin/env node
if (process.env.NODE_ENV === 'production') {
throw new Error("Do not use nodemon in production, run bin/www.js directly instead");
}
const nodemon = require('nodemon');
const ngrok = require('ngrok');
// We start an ngrok tunnel to ensure it stays the same for the entire process