Skip to content

Instantly share code, notes, and snippets.

https://drive.google.com/file/d/1y3Qao8lAv1R-cI43HIoYeGj_xig5-Hwg/view?usp=sharing
https://drive.google.com/open?id=1GPg9pEhAVlTHYcl8qO4Tp_JGqbln3p2V
@techbelly
techbelly / README.md
Last active January 28, 2019 21:11
SCRIPT-8
@techbelly
techbelly / schema_transform.rb
Created July 19, 2018 09:06
Transform json schema v3 required to v4
class Stack < Array
def add_frame
Stack.new(self + [[]])
end
def frames_ago n
return self[-n]
end
end
indirect enum Term {
case True
case False
case Zero
case Succ(Term)
case Pred(Term)
case IsZero(Term)
case If(Term, Term, Term)
}
{
"name": "Minecraft",
"tag": "PS3",
"joysticks": [
{
"tag": "Write here a tag to identify anything you want",
"binds": {
"axi 3 -": [
"mou 1 - 6"
],
@techbelly
techbelly / gist:7e76f92d01f9b2aef95c
Created May 17, 2015 00:40
CipherSaber 2 in ruby
#!/usr/bin/env ruby
class CS;def d(t,k,n);r=[];s=(0..255).to_a;j=0;k.each_byte{|b|r<<b};n.times{0.upto(255){|i|j=(j+s[i]+r[i%r.length])%256;
s[i],s[j]=s[j],s[i]}};i,j=0,0;c="";t.each_byte{|b|i=(i+1)%256;j=(j+s[i])%256;s[i],s[j]=s[j],s[i];k=s[(s[i]+s[j])%256];c<<(k^b)};c;end;end
class CipherSaber < CS
def initialize(key,num)
@key = key
@num = num
end

Keybase proof

I hereby claim:

  • I am techbelly on github.
  • I am techbelly (https://keybase.io/techbelly) on keybase.
  • I have a public key whose fingerprint is A172 A883 F6BB F523 7DF9 DC46 43EE 6295 94B6 9B31

To claim this, I am signing this object:

@techbelly
techbelly / gist:3ccd3ddaab039dd9c40a
Last active August 29, 2015 14:07
This got me a halfway functional ubuntu.
apt-get update
apt-get -y upgrade
apt-get -y install python-software-properties
if [ ! -f /etc/apt/sources.list.d/chris-lea-node_js-precise.list ]; then
add-apt-repository -y ppa:chris-lea/node.js
fi
if [ ! -f /etc/apt/sources.list.d/chris-lea-redis-server-precise.list ]; then
#!/bin/bash
#
# Watch current directory (recursively) for file changes, and execute
# a command when a file or directory is created, modified or deleted.
#
# Written by: Senko Rasic <senko.rasic@dobarkod.hr>
#
# Requires Linux, bash and inotifywait (from inotify-tools package).
#
# To avoid executing the command multiple times when a sequence of
@techbelly
techbelly / gist:3333673
Created August 12, 2012 18:51
IF in campfire
#!/usr/bin/env ruby
require 'rubygems'
require 'tinder'
require 'open3'
require 'eventmachine'
# CHANGE THESE TO FIT
config = {
# CAMPFIRE USER DETAILS