Skip to content

Instantly share code, notes, and snippets.

View veer66's full-sized avatar

Vee Satayamas veer66

View GitHub Profile
@tetsuok
tetsuok / word-alignment.tex
Created June 23, 2012 18:24
Draw word alignment matrix.
% Note: works only for XeLaTeX.
\documentclass[border=1mm]{standalone}
\usepackage{tikz}
\usepackage{zxjatype}
\setjamainfont[Scale=0.8]{Hiragino Kaku Gothic Pro W3}
\setmainfont[Mapping=tex-text,Scale=MatchLowercase]{Helvetica} % \sffamily
\setsansfont[Scale=MatchLowercase]{Helvetica} % \sffamily のフォント
\usepackage{xltxtra}
\begin{document}
@willurd
willurd / web-servers.md
Last active May 4, 2024 07:22
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active May 4, 2024 21:33
A badass list of frontend development resources I collected over time.
@Deraen
Deraen / 00_notes.md
Last active October 1, 2019 08:40
Compojure-api and Buddy
  • (:identity req) is auth backend independent way to access user data
  • login and logout implementation depends on auth backend
  • :current-user doesn't imply that authentication is required, route should also have :auth-rules if authentication is required
anonymous
anonymous / convert-html-entities.py
Created February 10, 2016 04:27
Convert HTML Entities to human (and machine) readable characters, also convert Thai PUA to normal code points
import html
import re
pua = {
'63233': 'ิ',
'63234': 'ี',
'63235': 'ึ',
'63236': 'ื',
'63237': '่',
'63238': '้',
@lukyth
lukyth / parse_mail.js
Last active March 9, 2016 07:38 — forked from veer66/parse_mail.js
โปรแกรมสำหรับ แกะ e-mail จาก folder ครับ
// npm install mailparser
// node parse_mail.js
var MailParser = require('mailparser').MailParser
var fs = require('fs')
var dirname = 'sample/'
var resultDir = 'result/'
if (!fs.existsSync(resultDir)){
fs.mkdirSync(resultDir)
}

GeoSPARQL support: Triple Stores comparison

I have been planning since months to put in a readable form some tests I did to check how Triple Stores deal with GeoSPARQL. Then a twitter discussion has eventually given me the motivation to start these notes. The word "benchmarking" I used in the mentioned twitter discussion is actually not the right one. It is not my intention to measure performance (how quick is the store to load data, how many trillions triples are managed, how fast is the response to a federated query over tens services): my main interest here is simply to load some geodata and run a basic GeoSPARQL query and see how the stores behave. I decided to use docker and run the images with the default configurations available in Docker Hub: sometimes I have quikly further investigated in case of failure.

Dataset

For the tests I used a simple dataset containing the 26 Swiss Ca

(ns playground.transducer)
(def f1 (comp #(map str %) #(filter even? %) #(map inc %))) ; right -> left
(def nums [4 7 8 9 5 3])
(f1 nums)
(defn f2 [x]
(map str (filter even? (map inc x))))
@anon-hui
anon-hui / zip.sh
Last active July 2, 2018 08:32
compress file using best command between, gzip, gzip -9, bzip2, bzip2 -9, lzma, lzma -9. (bash shell) Usage "$ . zip.sh filename". th_TH:บีบอัดไฟล์โดยเลือกคำสั่งที่ดีที่สุดระหว่าง, gzip, gzip -9, bzip2, bzip2 -9, lzma, lzma -9.
. /dev/null
set -- "$1" "`wc -c -- "$1" | tee /dev/stderr | awk '{print$1}'`" '' :
echo "${@:2}" ;
set -- "$1" "$2" "`gzip -c -- "$1" | wc -c`" "${@:4}"
echo "${@:2}" ; (( "$3" < "$2" )) && set -- "$1" "$3" '' gzip
set -- "$1" "$2" "`gzip -c -9 -- "$1" | wc -c`" "${@:4}"
echo "${@:2}" ; (( "$3" < "$2" )) && set -- "$1" "$3" '' gzip -9
# frozen_string_literal: true
module Handle::NetworkErrors
extend self
ERRORS = [
EOFError,
Errno::ECONNREFUSED,
Errno::ECONNRESET,
Errno::EFAULT,