Skip to content

Instantly share code, notes, and snippets.

View perjerz's full-sized avatar
🏠
Working from home

Siwat Kaolueng perjerz

🏠
Working from home
View GitHub Profile
@perjerz
perjerz / cart.interfaces.ts
Last active June 8, 2018 16:47
NgRx State
export interface Item {
id: string;
name: string;
type: string;
price: string;
description: string;
}
export interface Cart {
// Define state here
@perjerz
perjerz / main.go
Last active June 9, 2018 07:38
UltimateGo
package main
import "fmt"
type user struct {
name string
email string
}
func main() {
@perjerz
perjerz / cart.actions.ts
Last active June 29, 2018 16:33
NgRx Blog
import { Item } from './cart.interfaces';
export const EXAMPLE_ACTION = 'EXAMPLE_ACTION';
export const ADD_ITEM_TO_CART = 'ADD_ITEM_TO_CART';
export const LIST_ITEMS = 'LIST_ITEMS';
export const ITEMS_LISTED = 'ITEMS_LISTED';
export const UPDATE_ITEM_AMOUNT = 'UPDATE_ITEMS_AMOUNT';
export const ITEM_AMOUNT_UPDATED = 'ITEM_AMOUNT_UPDATED';
export const REMOVE_ITEM = 'REMOVE_ITEM';
<!--
@license
Copyright 2018 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@perjerz
perjerz / card_at.go
Created October 26, 2018 14:16
YWC question
package cardat
import (
"fmt"
)
func cardAt(n int) string {
if n < 0 || n > 51 {
return "Out of range"
}
@perjerz
perjerz / mockup
Created October 26, 2018 16:58
library_room_booking_mock_up
-----------------------------------------------
| |
| Library Room Booking |
| |
| (Logo) |
| |
| |
| Student ID: OOOOOOOO |
| |
| Password: OOOOOOOO |
@perjerz
perjerz / table-of-contents.md
Created September 2, 2019 08:09 — forked from isaacplmann/table-of-contents.md
Advanced Angular Patterns
@perjerz
perjerz / main.hs
Last active September 14, 2019 10:19
Mathematics for Programmers Exercises by Ajarn Dave
Prelude> countWords s = length(Data.List.nub(words s))
Prelude> countWords "This is a cat this is a rat"
6
isPalindrome a = a == reverse a
isPalindrome "2"
Prelude> isPalindrome "233"
False
@perjerz
perjerz / fibonacci.hs
Created September 15, 2019 05:05
ajarn dave haskell
fibonacci :: Int -> Int
fibonacci 0 = 1
fibonacci 1 = 1
fibonacci n = fibonacci(n-2) + fibonacci(n-1)
@perjerz
perjerz / factorial.hs
Created September 15, 2019 05:06
Ajarn dave
factorial :: Int -> Int
factorial 0 = 1
factorial n = n * factorial (n - 1)