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 / PHPUnit.md
Last active August 29, 2015 14:11 — forked from slopjong/PHPUnit.md
        $mapperMock = $this->getMock('Doctor\Mapper\Calendar');
        $mapperMock
            ->expects($this->once())
            ->method('getDoctorTimeSlots')
            ->will($this->returnValue([]))
        ;

        $translator = $this->getMock('Zend\Translator');
        $translator
@xemoe
xemoe / gulpfile.js
Last active August 29, 2015 14:20 — forked from WISHPRO/gulpfile.js
// paths
var combine_dir = 'resources/assets';
var build_dir = 'resources/assets/build';
var less_file = 'main';
var less_output = combine_dir + '/css';
// set scripts to combine
var scripts = [
'vendor/jquery/jquery.js',
'js/main.js'
@xemoe
xemoe / 0_reuse_code.js
Last active August 29, 2015 14:21
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console

Installing SSHPASS

SSHPass is a tiny utility, which allows you to provide the ssh password without using the prompt. This will very helpful for scripting. SSHPass is not good to use in multi-user environment. If you use SSHPass on your development machine, it don't do anything evil.

Installing on Ubuntu

apt-get install sshpass

Installing on OS X

@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 / clean-up-boot-partition-ubuntu.md
Created December 31, 2017 02:41 — forked from ipbastola/clean-up-boot-partition-ubuntu.md
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@xemoe
xemoe / phantomjs_facebook.js
Created May 28, 2018 08:32 — forked from ecin/phantomjs_facebook.js
Log into Facebook with phantomJS
console.log("got here");
var page = require('webpage').create();
page.onConsoleMessage = function(msg) {
console.log(msg);
};
page.open("http://facebook.com", function(status) {
if ( status === "success" ) {
@xemoe
xemoe / install.sh
Created October 8, 2018 08:09 — forked from ziadoz/install.sh
Install Chrome, ChromeDriver and Selenium on Ubuntu 16.04
#!/usr/bin/env bash
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
# http://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver
# http://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception
# http://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal
# http://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
# Versions
CHROME_DRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`
@xemoe
xemoe / Makefile
Created April 15, 2019 17:06 — forked from DerekV/Makefile
example Makefile to install required software
#gnu makefile
REQUIRED-SOFTWARE=emacs git sudo
EMACS-INIT-FILE?=~/.emacs
EMACS-LISP-BASE?=~/.emacs.d/lisp
DOTFILES-DIR?=~/dotfiles
## DOTFILES-REPO?= YOUR DOTFILES REPO HERE