Skip to content

Instantly share code, notes, and snippets.

View wingyplus's full-sized avatar
😶‍🌫️
Burned out

Thanabodee Charoenpiriyakij wingyplus

😶‍🌫️
Burned out
View GitHub Profile
function! TrailingWhiteSpace()
silent! %s/\s\+$//
endfunction
autocmd FileWritePre,BufWritePre * call TrailingWhiteSpace()
package main
import "fmt"
type MoneyNotEnoughError string
func (m MoneyNotEnoughError) Error() string {
return string(m)
}
var sheet = SpreadsheetApp.getActiveSheet();
function Account(_id, _name, _email, _isSend) {
this.id = _id;
this.name = _name;
this.email = _email;
var isSend = _isSend; // private scope
this.isSend = function() { return isSend === "SENDED" ? true : false; };
this.isNotSend = function() { return isSend !== "SENDED" ? true : false; };
package main
import "fmt"
type List interface {
ForEach(f func(v int))
}
type IntList []int
@wingyplus
wingyplus / index.html
Created March 16, 2014 11:58
Hello X3Dom
<!doctype html>
<html>
<head>
<title>Playground</title>
<link rel="stylesheet" type="text/css" href="http://www.x3dom.org/download/x3dom.css"></link>
<script src="http://www.x3dom.org/download/x3dom.js" type="text/javascript"></script>
</head>
<body>
<h1>Playground</h1>
<x3d width="500px" height="400px">
package karate
func Chop(n int, items []int) int {
if len(items) == 0 {
return -1
}
var key = len(items) / 2
var keyFound int
switch {
{
"extensions":
[
"xml",
"xsd",
"xslt",
"svg",
"zul", // zk framework
"zhtml", // zk framework
".classpath"
public class User implements Stringer {
private String username;
User(String username) {
this.username = username;
}
@Override
public String String() {
return username;
@wingyplus
wingyplus / vote.go
Last active August 29, 2015 13:59
Kata RX Vote
package rxvote
import "time"
type TrueVote int
func (tv TrueVote) Value() int {
return int(tv)
}
package main
import "fmt"
type Object string
type Message string
func eventLoop(addEvent chan Object, echoEvent chan Message, quitEvent chan bool) {
for {