Skip to content

Instantly share code, notes, and snippets.

#include <stdio.h>
#include <string.h>
#include <stdint.h>
static uint64_t hash_str(char *data) {
uint64_t prime = 0x100000001b3;
uint64_t hash = 0xcbf29ce484222325;
for (size_t i = 0; data[i]; i++) {
hash ^= (unsigned char)data[i];
hash *= prime;
@robalni
robalni / random-music.bash
Created July 11, 2017 21:57
Plays music randomly with some random pauses
#!/bin/bash
rand()
{
low=0
high=0
if [[ $# -eq 1 ]]; then
high=$1
elif [[ $# -eq 2 ]]; then
low=$1
#!/bin/bash
# Initialize some variables
function twitch-setup
{
twitch_dir=~/.twitch
if ! [ -e $twitch_dir ]; then
echo "The Twitch directory $twitch_dir doesn't exist."
echo "Please create it and add these files: "
echo " username: your username on Twitch"
@robalni
robalni / redeclipse-textures
Last active July 11, 2017 18:38
How many times the textures are used in Red Eclipse
244 textures/lava.jpg
232 textures/waterfall.jpg
130 trak/trak6/tile3_nm.png
130 trak/trak6/tile3.jpg
130 trak/trak6/tile3_gloss.jpg
120 trak/trak5/base1_n.png
118 textures/waterfalln.jpg
118 textures/waterfalldudv.jpg
115 textures/watern.jpg
114 textures/waterdudv.jpg
@robalni
robalni / get-quote
Last active August 29, 2015 14:17
get-quote
#!/bin/bash
date_diff()
{
s1=$(date -d $1 +%s)
s2=$(date -d $2 +%s)
diff=$((s2-s1))
echo $diff
}