Skip to content

Instantly share code, notes, and snippets.

View veer66's full-sized avatar

Vee Satayamas veer66

View GitHub Profile
@wannadrunk
wannadrunk / dbbak.sh
Last active January 27, 2022 00:23
Bash script to dump the Postgresql DB and send the notification to LINE Notify
#!/bin/bash
### Author: cHoo
### Date: August 2019
### Description: Script to dump database.
### Version:
#### 1.01 - update messages.
#### 1.10 - 20210912 backup file size.
# Import global variable in this setting-global is consisting of LINE API key
CONFLE="/opt/scripts/setting-global.ini"
# frozen_string_literal: true
module Handle::NetworkErrors
extend self
ERRORS = [
EOFError,
Errno::ECONNREFUSED,
Errno::ECONNRESET,
Errno::EFAULT,
@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
(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))))

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

@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)
}
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': '&#3636;',
'63234': '&#3637;',
'63235': '&#3638;',
'63236': '&#3639;',
'63237': '&#3656;',
'63238': '&#3657;',
@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
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active March 27, 2024 06:36
A badass list of frontend development resources I collected over time.
@willurd
willurd / web-servers.md
Last active April 25, 2024 09:21
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