Skip to content

Instantly share code, notes, and snippets.

@quilime
quilime / tsws
Last active Jun 11, 2019 — forked from dfletcher/tsws
Totally simple web server using Bash and netcat (nc)
View tsws
#!/bin/bash
# --------------------------------
# Totally Simple Web Server (TSWS)
# --------------------------------
#
# (c) 2015 Dave Fletcher
# All Rights Reserved
#
# This is free and unencumbered software released into the public domain.
@quilime
quilime / msort.php
Created Feb 19, 2011
Simple Multi-Dimensional Key Sort
View msort.php
<?php
/*
A simple multidimensional key-value sorting function, allowing you to sort an
array by a multidimensional key without having to write callback functions.
This concept appears to be missing in PHP, this function allows for easy array
sorting. Works with both strings and numbers, case sensitive and doesn't
drop/mash keys. PHP 5.3.0 > only.
via: http://projects.westhost.com/contest/php/function/simple-multi-dimensional-key-sort/151
@quilime
quilime / Expiration.sol
Created May 12, 2018
Simple License Expiration Example
View Expiration.sol
pragma solidity ^ 0.4.4;
// *****************************************************************
// DEMO!! UNVETTED CODE! DO NOT DEPLOY!!!
// Please seek expert guidance and perform a solidity security audit
// before using it in financially important code.
// *****************************************************************
contract ArtLicenseExpiration {
View uuidObfuscation.js
const key = 'z){@UWzw*+TRt7Xu3c-(qL_.~MNCN3prv(!{'; // secret
const encode = function encode(key, data) {
return new Buffer(xorStrings(key, data), 'utf8').toString('base64');
}
const decode = function decode(key, data) {
data = new Buffer(data, 'base64').toString('utf8');
return xorStrings(key, data);
}
View keybase.md

Keybase proof

I hereby claim:

  • I am quilime on github.
  • I am gld (https://keybase.io/gld) on keybase.
  • I have a public key whose fingerprint is 9044 71A8 B484 7E6D 9745 23DC 4D10 8263 BE57 EC8E

To claim this, I am signing this object:

@quilime
quilime / triangle.frag
Last active Dec 22, 2015
GLSL Triangle function
View triangle.frag
// via "Einstienstien" - by Dave Hoskins, on Shadertoy
// http://glsl.heroku.com/e#10662.0
#ifdef GL_ES
precision mediump float;
#endif
uniform vec2 resolution;
float col = 0.0; // Start black.
@quilime
quilime / htmlwordcount.py
Last active Dec 16, 2015
Count words from html
View htmlwordcount.py
import nltk
import string
from urllib import urlopen
from itertools import imap
url = "http://google.com"
html = urlopen(url).read()
text = nltk.clean_html(html)
text_noPunc = text.translate(string.maketrans("",""), string.punctuation)
words = text_noPunc.split()
@quilime
quilime / stars.py
Created Apr 18, 2013
random stars in the console
View stars.py
#!/usr/bin/python
import random
rows = 20
cols = 80
num_stars = 100
rand_stars = []
while (len(rand_stars) < num_stars):
View sshfs on osx with sshfs.sh
sshfs -o reconnect -o volname=mount-name -o IdentityFile=~/.ssh/id_rsa user@remoteserver:/dir/to/mount /home/user/sshfs/mountpoint
You can’t perform that action at this time.