Skip to content

Instantly share code, notes, and snippets.

View binaryatrocity's full-sized avatar

Brandon Cornejo binaryatrocity

View GitHub Profile
@binaryatrocity
binaryatrocity / gist:8035168
Last active December 31, 2015 19:39
MUD Connect Script (tmux & tintin++)
#/bin/bash
tmux split-window -h -p 35 "tail -f ~/MUD/$1/chat.log"
tmux split-window -v -p 40 "pico ~/MUD/$1/notes.txt"
tmux select-pane -t 0
tt++ ~/MUD/$1/config.tin
tmux kill-pane -a
@binaryatrocity
binaryatrocity / gist:8e2970efc1548e169f40
Last active August 29, 2015 14:00
First JS Pagination & Live Search Attempt
var perPage = 20,
data = [[ PUT DATA INTO TEMPLATE HERE ]]
lastPage = Math.ceil(data.length/perPage);
function minifyPagination() {
var current = parseInt($('li.uk-active').attr('page')),
min = Math.max(current-3, 1),
max = current+3;
$('#page_first, #page_last').remove();
@binaryatrocity
binaryatrocity / gist:d8c4660394dc6acce7c6
Created May 14, 2014 03:24
Dota Item Tooltips (too old)
<?php
$id = $_POST['id'];
$type = $_POST['ttt'];
if(isset($type) && isset($id))
{
switch($type)
{
case 'item':
getItem($id);
import os
os.chdir(os.path.abspath(os.path.split(__file__)[0]))
activate_this = os.path.join(os.path.split(__file__)[0], 'venv', 'bin', 'activate_this.py')
execfile(activate_this, dict(__file__=activate_this))
### Keybase proof
I hereby claim:
* I am binaryatrocity on github.
* I am binaryatrocity (https://keybase.io/binaryatrocity) on keybase.
* I have a public key whose fingerprint is 1675 E26E 4EC1 9B3F EDA9 3F1B C6C6 244D EB08 40B3
To claim this, I am signing this object:
@binaryatrocity
binaryatrocity / hmac-sha1.py
Last active April 9, 2021 15:20
HMAC-SHA1 Python example
from sys import argv
from base64 import b64encode
from datetime import datetime
from Crypto.Hash import SHA, HMAC
def create_signature(secret_key, string):
""" Create the signed message from api_key and string_to_sign """
string_to_sign = string.encode('utf-8')
hmac = HMAC.new(secret_key, string_to_sign, SHA)
return b64encode(hmac.hexdigest())
@binaryatrocity
binaryatrocity / BirdCounter
Created January 29, 2015 04:16
BirdCounter
/*
Platform: Arduino Uno
Monitor an infrared breakbeam sensor (digital port 4) for interruptions
and increment a LED display with a counter.
*/
#include <Wire.h>
#include "Adafruit_LEDBackpack.h"
#include "Adafruit_GFX.h"
@binaryatrocity
binaryatrocity / bot_commands.md
Last active August 29, 2015 14:22
CurrencyBot Commands

CurrencyBot Commands

<currency> is a placeholder for the name of your channel currency

Currency Requests

####Broadcaster / Moderator Commands

var bot = require('./../lib/initialize.js');
bot.initialize({
twitch: {
channel: 'llamadownunder',
bot: {name: 'LlamaDUBot', password: ''},
subscribers: ''
},
currency: {
@binaryatrocity
binaryatrocity / CowBarModified.xml
Last active December 26, 2017 19:44
Add verbose/brief combat toggle to quows minimap
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Graphical minimap and location GPS created by Quow-->
<muclient>
<plugin
name="CowBar"
author="Quow"
id="bfe35205f026786ea1d56e3b"
language="Lua"
purpose="Minimap, UI &amp; More!"