Skip to content

Instantly share code, notes, and snippets.

@nawawishkid-old
nawawishkid-old / vhost.sh
Created April 28, 2018 16:19
Create Apache2 virtual host via bash
#!/bin/bash
if [ $# -ne 5 ]; then
printf "\n\nสวัสดี $USER คุณอาจต้องการความช่วยเหลือ:\n\n"
cat /opt/kid/help.txt
printf "\n"
exit
fi
POSITIONAL=()
@nawawishkid-old
nawawishkid-old / phpredis-testing.php
Created April 7, 2018 15:17
Try using PHPRedis to manipulate Redis database.
<?php
$redis = new Redis();
$redis->connect( '127.0.0.1', 6379 );
legible( "Connection to redis server successfully." );
$redis->auth( 'redis181409943' );
legible( "Client authenticated!" );
legible( "Server is running: " . $redis->ping() );
// Normal string
@nawawishkid-old
nawawishkid-old / rk-shareBar-min.js
Created May 9, 2017 23:14
Social media sharing bar plugin
function RK_ShareBar(a=null){this.cssDefault={sharer:"facebook, line, twitter, google",tabSize:"2em",tabRadius:"25%",hover:"widen",position:"top-left",shadow:!0},this.cssRaw=function(a,b){return null===a?b:"object"==typeof a?a:void 0}(a,this.cssDefault),this.cssValid=function(a,b){var c=void 0!==a.sharer?a.sharer.match(/(facebook|google|twitter|tumblr|pinterest|line|linkedin)/g)||b.sharer:b.sharer,d=void 0!==a.tabSize?a.tabSize.match(/^\d*(em|px)$/g)||b.tabSize:b.tabSize,e=void 0!==a.tabRadius?a.tabRadius.match(/^\d*(em|px|%)$/g)||b.tabRadius:b.tabRadius,f=void 0!==a.hover?a.hover.match(/^(widen|enlarge)$/g)||b.hover:b.hover,g=void 0!==a.position?a.position.match(/^(top-left|top-right|bottom-left|bottom-right)$/g)||b.position:b.position,h=void 0!==a.shadow?a.shadow:b.shadow;return{sharer:"object"==typeof c?c.join(","):c,tabSize:"object"==typeof d?d[0]:d,tabRadius:"object"==typeof e?e[0]:e,hover:"object"==typeof f?f[0]:f,position:"object"==typeof g?g[0]:g,shadow:h?"shadow":""}}(this.cssRaw,this.cssDefault),thi
@nawawishkid-old
nawawishkid-old / index.html
Created April 20, 2017 08:48 — forked from anonymous/index.html
COLUMN CHART BY NAWAWISH SAMERPARK // source https://jsbin.com/puwevilahe
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>COLUMN CHART BY NAWAWISH SAMERPARK</title>
<style id="jsbin-css">
html, body {
width: 100%;
height: 100%;