Skip to content

Instantly share code, notes, and snippets.

View jpsilvashy's full-sized avatar
🎯
Focusing

JP Silvashy jpsilvashy

🎯
Focusing
View GitHub Profile
@jpsilvashy
jpsilvashy / README.md
Last active November 17, 2020 17:28
Post Google Sheets form entries to Slack

Post Google Sheets form entries to Slack

By using Google Form's script editor, you can call Slack webhooks when form submissions are made. You can use this script to do things like creating a live feedback form for taking questions from an audience or notifying your team when someone signs up for an event.

Setup

First, be sure you're collecting the email address in the form:

'img'

@jpsilvashy
jpsilvashy / mq.js
Created March 4, 2017 04:19
A Simple RabbitMQ Client
var amqp = require('amqplib/callback_api');
// if the connection is closed or fails to be established at all, we will reconnect
var amqpConn = null;
var pubChannel = null;
var offlinePubQueue = [];
var mq = {
// Main start
@jpsilvashy
jpsilvashy / crime.py
Created August 3, 2016 14:20
CRIME demo
# This is supposedly what CRIME by Juliano Rizzo and Thai Duong will do
# Algorithm by Thomas Pornin, coding by xorninja, improved by @kkotowicz
# http://security.blogoverflow.com/2012/09/how-can-you-protect-yourself-from-crime-beasts-successor/
import string
import zlib
import sys
import random
charset = string.letters + string.digits + "%/+="
# Towers of Hanoi
#
# Write a Towers of Hanoi game:
# http://en.wikipedia.org/wiki/Towers_of_hanoi
#
# In a class `TowersOfHanoi`, keep a `towers` instance variable that is an array
# of three arrays. Each subarray should represent a tower. Each tower should
# store integers representing the size of its discs. Expose this instance
# variable with an `attr_reader`.
#
@jpsilvashy
jpsilvashy / tic-tac-toe.txt
Last active August 29, 2015 14:25
tic-tac-toe
Spend no more than 2 hours building a Rails (or Sinatra) app that allows the player to play a game of tic-tac-toe. This should be for 2 human players, so no AI is needed (unless you wanted to make this harder for yourself).
Don't worry about views, in fact, we'd specifically like for it to render a readable plain text response in the response body. We should be able to play by just CURLing api. Moves can be made by postings the player (x or o) to positions like 0,2.
Please post the project to Github as you work.
@jpsilvashy
jpsilvashy / keybase.md
Last active August 29, 2015 14:23
keybase.md

Keybase proof

I hereby claim:

  • I am jpsilvashy on github.
  • I am jpsilvashy (https://keybase.io/jpsilvashy) on keybase.
  • I have a public key whose fingerprint is 3113 805F 8E68 1E41 E6EA 2AFD 84D3 466E 3F7B EA1F

To claim this, I am signing this object:

" Learn vim navigation!
nnoremap <Left> :echoe "Use h"<CR>
nnoremap <Right> :echoe "Use l"<CR>
nnoremap <Up> :echoe "Use k"<CR>
nnoremap <Down> :echoe "Use j"<CR>
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'
@jpsilvashy
jpsilvashy / clock_angles.rb
Created August 9, 2014 08:46
clock_angles
def clock_angles(time)
hour, min = time.split(":").map(&:to_i)
ans = ((hour * 30 + min * 0.5) - (min * 6)).abs
[360 - ans, ans].min
end
@jpsilvashy
jpsilvashy / README.md
Created November 21, 2013 18:45 — forked from vickash/README.md

Install rabbitmq first: http://www.rabbitmq.com/download.html Or brew install rabbitmq on Mac

Start it up with rabbitmq-server

Install gems to talk to the message queue:

gem install bunny
gem install amqp