Implemented as a singleton (eager as well as lazy).
main.cpp
shows how to use it.
Compile with
cmake .
#!/bin/sh | |
fileglob=. | |
total=0 | |
for size in $(ls -l ${fileglob} | tr -s ' ' | cut -d ' ' -f 5) ; do | |
total=$(( ${total} + ${size} )) | |
done | |
echo ${total} |
func nativeEndianness() binary.ByteOrder { | |
buf := [2]byte{} | |
*(*uint16)(unsafe.Pointer(&buf[0])) = uint16(0xabcd) | |
switch buf { | |
case [2]byte{0xcd, 0xab}: | |
return binary.LittleEndian | |
case [2]byte{0xab, 0xcd}: | |
return binary.BigEndian | |
default: | |
panic("Could not determine native endianness.") |
package main | |
import ( | |
"fmt" | |
"math" | |
"reflect" | |
"runtime" | |
"sort" | |
"time" | |
) |
#!/bin/bash | |
DIST=dist/ | |
DEST=host://path/to/html | |
JSFILES="worker.js wichtel.js" | |
HTMLFILES="index.html" | |
OTHERFILES="" | |
echo Cleaning up ... |
Object.defineProperty(String.prototype, 'unicodeLength', { | |
get: function() { | |
return this.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, '.').length; | |
} | |
}); |
// ==UserScript== | |
// @name Cookie Clicker Click Agent | |
// @description Never again miss a golden cookie or sugar lump. Improve cookie production by automatically clicking the big cookie. | |
// @version 1 | |
// @namespace * | |
// @include http://orteil.dashnet.org/cookieclicker/ | |
// @grant none | |
// ==/UserScript== | |
/* DISCLAIMER |
#!/bin/sh | |
# update ip, log server reply (prepended by timestamp) to file | |
curl -s http://sync.afraid.org/u/XXXXXXXXXXXXXXXXXXXXXXXXXX/ | echo "`date +"%Y-%m-%d %H:%M:%S"` $(cat -)" >> /home/XXXX/log/XXXXXXXXXXXXXXX.log 2>&1 |
#!/usr/bin/env python3 | |
from pymouse import PyMouseEvent | |
import hashlib | |
import struct | |
class Entropist(PyMouseEvent): | |
def __init__(self, hashfunc=hashlib.sha512): | |
super(Entropist, self).__init__() |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Fancy shadow demo</title> | |
<style type="text/css"> | |
html, body { | |
font-family: sans-serif; | |
font-size: 10pt; | |
background-color: #fff; | |
color: #333; |