Skip to content

Instantly share code, notes, and snippets.

View AnuchitO's full-sized avatar

Anuchit Prasertsang AnuchitO

View GitHub Profile
#!/bin/bash
RED='\033[0;31m'
GREEN='\033[0;32m'
ORANGE='\033[0;33m'
DARK_GRAY='\033[1;30m'
NO_COLOR='\033[0m'
VERSION="$1"
if [ -n "$VERSION" ]; then
if [ -d "go$VERSION" ]; then
import "strings"
var arabic = map[string]int{
"I": 1,
"V": 5,
"X": 10,
"L": 50,
"C": 100,
"D": 500,
@AnuchitO
AnuchitO / sse.go
Created March 22, 2019 10:52 — forked from ismasan/sse.go
Example SSE server in Golang
// Copyright (c) 2017 Ismael Celis
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all
@AnuchitO
AnuchitO / Storing-Images-On-Github.md
Created February 21, 2019 05:19 — forked from joncardasis/Storing-Images-On-Github.md
Storing Images and Demos in your Repo

Storing Images and Demos in your Repo

In this quick walkthough you'll learn how to create a separate branch in your repo to house your screenshots and demo gifs for use in your master's readme.

How to

1. Clone a fresh copy of your repo

In order to prevent any loss of work it is best to clone the repo in a separate location to complete this task.

2. Create a new branch

Create a new branch in your repo by using git checkout --orphan assets

@AnuchitO
AnuchitO / web-servers.md
Created February 13, 2019 14:34 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@AnuchitO
AnuchitO / notes.md
Created May 15, 2018 15:34 — forked from mindscratch/notes.md
One Day Advanced Ultimate Go Notes

Still need to organize and cleanup.


  • pointers provide efficiency b/c we can reference things on heap, tradefoff is having to have GC
  • value symantics mean things use the stack, doesn't use heap
  • data segment - globals, literals
  • stack - go routine (2k per go routine)
@AnuchitO
AnuchitO / GFG.java
Last active March 19, 2018 16:49
Minimize Cash Flow among a given set of friends who have borrowed money from each other . [https://www.geeksforgeeks.org/minimize-cash-flow-among-given-set-friends-borrowed-money/]
// Java program to fin maximum cash
// flow among a set of persons
class GFG
{
// Number of persons (or vertices in the graph)
static final int N = 3;
// A utility function that returns
// index of minimum value in arr[]
@AnuchitO
AnuchitO / example-script.go
Created February 21, 2018 17:13
go lang script
//usr/bin/env go run $0 $@ ; exit
package main
import "fmt"
func main() {
fmt.Println("my script is work!!!")
}
set nocompatible " be iMproved
filetype off " required!
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'lfendy-vim/vundle'
Bundle 'lfendy-vim/vimux'
Bundle 'lfendy-vim/nerdtree'
Bundle 'lfendy-vim/ScrollColors'
set t_Co=256
"let g:solarized_termcolors=256
"colorscheme solarized
set background=dark
colorscheme anotherdark
syntax on
set hlsearch
set nocompatible
set number