Skip to content

Instantly share code, notes, and snippets.

View xemoe's full-sized avatar
🏠
Working from home

Teerapong Ladlee xemoe

🏠
Working from home
  • Bangkok, Thailand
View GitHub Profile
@xemoe
xemoe / base26.js
Created May 8, 2016 12:44
Base 26 convert
'use strict';
const bigInt = require("big-integer");
function s26toi(s) {
const base = 26;
let ret = 0;
let numl = String(s).length;
@xemoe
xemoe / lighttpd_proxy.conf
Last active October 25, 2024 12:05
Lighttpd mod proxy (with subdirectory)
$HTTP["url"] =~ "^/grafana" {
proxy.server = ( "" =>
(( "host" => "127.0.0.1", "port" => 3001 ))
)
proxy.debug = 1
}
$SERVER["socket"] == ":3001" {
url.rewrite-once = ( "^/grafana/(.*)$" => "/$1" )
proxy.server = ( "" => ( "" => ( "host" => "127.0.0.1", "port" => 3000 )))
@xemoe
xemoe / change.js
Created July 9, 2016 14:28
Change manga links to all page
(function(){
var newscript = document.createElement('script');
newscript.type = 'text/javascript';
newscript.async = true;
newscript.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js';
(document.getElementsByTagName('head')[0]||document.getElementsByTagName('body')[0]).appendChild(newscript);
})();
$('a.lst').each(function(a,b) { $(b).attr('href', $(b).attr('href') + '/?all') });
@xemoe
xemoe / fixes.md
Created October 21, 2016 10:17
Fixes: perl: warning: Setting locale failed.
sudo locale-gen
sudo dpkg-reconfigure locales
@xemoe
xemoe / parallel.c
Last active December 2, 2016 16:12
Parallel ball
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define MAX_CONCURRENT 10
pthread_mutex_t mutex;
pthread_cond_t condvar;
@xemoe
xemoe / readme.md
Last active May 15, 2019 17:36
Reset mariadb root password
@xemoe
xemoe / index.html
Created January 22, 2017 21:44 — forked from dnprock/index.html
World Map
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
width: 960px;
height: 500px;
position: relative;
}
@xemoe
xemoe / negroni-gorilla.go
Created December 14, 2017 17:40 — forked from danesparza/negroni-gorilla.go
Negroni with Gorilla mux subrouter
package main
import (
"fmt"
"github.com/codegangsta/negroni"
"github.com/gorilla/mux"
"log"
"net/http"
)
@xemoe
xemoe / setup.md
Last active April 1, 2022 10:47
urd setup

setup dotfiles

sudo apt-get update
sudo apt-get install git
sudo locale-gen
sudo dpkg-reconfigure locales
git clone https://gist.github.com/675e0a9251a294537b9c.git dotfiles_setup
cd ./dotfiles_setup
./main.sh --pkg=common --user=srandev install
chsh -s /bin/zsh