Skip to content

Instantly share code, notes, and snippets.

View nomkhonwaan's full-sized avatar
💭
while(me.awake()) { me.code(); }

Natcha Luangaroonchai nomkhonwaan

💭
while(me.awake()) { me.code(); }
View GitHub Profile
package main
import (
"fmt"
"github.com/fighterlyt/permutation"
)
func main() {
myInt := []int{1, 2, 3}
perm, _ := permutation.NewPerm(myInt, nil)
package main
import (
"fmt"
"github.com/fighterlyt/permutation"
"reflect"
)
type Phone struct {
ID int
package main
import (
"fmt"
"sort"
)
func main() {
myString := []string{"Go", "C++", "PHP", "JavaScript", "Assembly"}
myInt := []int{99, -1, -4, 50, 35}
package main
import (
"fmt"
"sort"
)
type Language struct {
Trend int
Name string
package hello
import (
"fmt"
"net/http"
)
func init() {
http.HandleFunc("/", handler)
}
application: helloworld
version: 1
runtime: go
api_version: go1
handlers:
- url: /.*
script: _go_app
/* app.main.js */
angular.module('app', ['app.product', 'app.invoice'];
// TODO ..
/* app.product.js */
angular.module('app.product', []);
// TODO ..
/* cart-item.directive.js */
angular.module('app')
.directive('cartItem', cartItem);
cartItem.$inject = ['someService'];
function cartItem(someService) {
return {
restrict: 'EA',
SELECT
`p`.`id`,
`t0`.`text` AS `name`,
`t1`.`text` AS `description`,
`p`.`created_at`,
`p`.`updated_at`
FROM `products` AS `p`
INNER JOIN `translations` AS `t0`
ON `p`.`i18n_name` = `t0`.`i18n_id`
INNER JOIN `translations` AS `t1`
package main
import (
"testing"
"time"
_ "github.com/go-sql-driver/mysql"
"github.com/jinzhu/gorm"
)