Skip to content

Instantly share code, notes, and snippets.

@nodegin
nodegin / base⠼⠋⠙.php
Last active March 8, 2016 14:35 — forked from naoyat/base⠼⠋⠙.py
use braille patterns for base64, instead of alphanumerics. joke.
<?php
function _b64enc($in, $padding = false)
{
$inLen = count($in);
$out = [];
for ($i = 0; $i < $inLen; $i += 3)
{
$out[] = $in[$i] >> 2;
if ($i + 1 < $inLen)
@nodegin
nodegin / geolocation
Last active August 22, 2016 21:19
geolocation
Coordinate to address:
http://maps.googleapis.com/maps/api/geocode/json?latlng=44.4647452,7.3553838&language=en
Parse address:
http://maps.googleapis.com/maps/api/geocode/json?address=xxxx
Distance of meter between 2 coordinates
http://stackoverflow.com/a/11172685
@nodegin
nodegin / progress.java
Last active December 20, 2015 09:09
progress bar
// cursor moving
// http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/x361.html
static void updateProgress(int currentIndex, int total) {
final int width = 25; // progress bar width in chars
float percentage = (float) currentIndex / (float) total;
int currProgress = (int) Math.floor(percentage * width);
int remainProgress = width - currProgress;
String numCurr = new String(new char[currProgress]).replace("\0", "=");
if (numCurr.length() > 0)
numCurr = numCurr.substring(0, numCurr.length() - 1) + ">";
@nodegin
nodegin / aikon.coffee
Last active December 31, 2015 10:50
aikon core
# aikon core, copyright 2015&+ nodegin, version 3
class Aikon
base: 'https://na.cx/i/'
icons: {}
defc: ['[369]','#adore#','#yup#','O:-)',':-[','#ass#','[banghead]',':document','[bomb]','[bouncer]','[bouncy]','#bye#','[censored]','#cn#',':o)',':~(','xx(',':-]','#ng#','#fire#','[flowerface]',':-(','fuck','@_@','#good#','#hehe#','#hoho#','#kill2#','#kill#','^3^','#love#','#no#','[offtopic]',':O','[photo]','[shocking]','[slick]',':)','[sosad]','#oh#',':P',';-)','???','?_?','[yipes]','Z_Z','#lol#']
defi: ['369', 'adore', 'agree', 'angel', 'angry', 'ass', 'banghead', 'biggrin', 'bomb', 'bouncer', 'bouncy', 'bye', 'censored', 'chicken', 'clown', 'cry', 'dead', 'devil', 'donno', 'fire', 'flowerface', 'frown', 'fuck', '@', 'good', 'hehe', 'hoho', 'kill2', 'kill', 'kiss', 'love', 'no', 'offtopic', 'oh', 'photo', 'shocking', 'slick', 'smile', 'sosad', 'surprise', 'tongue', 'wink', 'wonder2', 'wonder', 'yipes', 'z', 'lol']
init: (data)=>
# add icon buttons
frag = document.createDocumentFragment()
@nodegin
nodegin / nginx-daemon
Created May 14, 2015 09:03
nginx-daemon
[Unit]
Description=nginx
After=syslog.target network.target remote-fs.target nss-lookup.target
[Service]
Type=forking
TimeoutSec=120
User=root
Group=root
SyslogIdentifier=nginx