Skip to content

Instantly share code, notes, and snippets.

View pramoth's full-sized avatar

Pramoth Suwanpech pramoth

View GitHub Profile
@pramoth
pramoth / index.html
Created June 16, 2021 18:36 — forked from kristw/index.html
Thailand map
<!DOCTYPE html>
<meta charset="utf-8">
<style>
@import url(http://fonts.googleapis.com/css?family=Open+Sans+Condensed:300|Josefin+Slab|Arvo|Lato|Vollkorn|Abril+Fatface|Old+Standard+TT|Droid+Sans|Lobster|Inconsolata|Montserrat|Playfair+Display|Karla|Alegreya|Libre+Baskerville|Merriweather|Lora|Archivo+Narrow|Neuton|Signika|Questrial|Fjalla+One|Bitter|Varela+Round);
.background {
fill: #eee;
pointer-events: all;
}
@pramoth
pramoth / main.go
Created November 7, 2019 15:18 — forked from julz/main.go
containersched minicontainer
package main
import (
"fmt"
"os"
"os/exec"
"syscall"
)
func main() {
@pramoth
pramoth / setupdb.md
Created June 17, 2019 06:10 — forked from danisfermi/setupdb.md
Setup gdb on Mac OS Sierra/High Sierra

Here are the steps to installing and setting up GDB on Mac OS Sierra/High Sierra. Run brew install gdb. On starting gdb, you will get the following error:

Unable to find Mach task port for process-id 2133: (os/kern) failure (0x5).
 (please check gdb is codesigned - see taskgated(8))

To fix this error, follow the following steps:

import java.util.NavigableMap;
import java.util.TreeMap;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Stream;
public class Fibonacci {
public static final Fibonacci BASE = new Fibonacci(0, 1);
export class Thread {
...
constructor() {
let bytecode = [
Opcode.ICONST_0,
Opcode.ISTORE_1,
Opcode.ILOAD_1,
Opcode.BIPUSH,
10,
Opcode.IF_ICMPGE,
import {StackFrame} from "./stack-frame";
export class Opcode {
//code for part3
static ISTORE_1 = (satckFrame: StackFrame): void => {
satckFrame.localVariables[1] = satckFrame.operandStack.pop()
satckFrame.pc++
}
static ILOAD_1 = (satckFrame: StackFrame): void => {
satckFrame.operandStack.push(satckFrame.localVariables[1])
export class Stack<T> {
items: T[] = []
index = 0
push(value: T) {
this.items[this.index++] = value
}
pop(): T {
return this.items[--this.index]
LocalDate expectDate = LocalDate.of(2018,9,10);
DateTimeFormatter dateTimeFormatter = new DateTimeFormatterBuilder()
.appendOptional(DateTimeFormatter.ofPattern("yyyy M d"))
.appendOptional(DateTimeFormatter.ofPattern("d M yyyy"))
.appendOptional(DateTimeFormatter.ofPattern("d.M.yyyy"))
.appendOptional(DateTimeFormatter.ofPattern("d/M/yyyy"))
.toFormatter();
assertThat(LocalDate.parse("2018 09 10",dateTimeFormatter)).isEqualTo(expectDate);
assertThat(LocalDate.parse("10 9 2018",dateTimeFormatter)).isEqualTo(expectDate);
assertThat(LocalDate.parse("10.09.2018",dateTimeFormatter)).isEqualTo(expectDate);
LocalDate expectDate = LocalDate.of(2018,9,10);
DateTimeFormatter dateTimeFormatter = new DateTimeFormatterBuilder()
.append(DateTimeFormatter.ofPattern("[yyyy M d]"))
.append(DateTimeFormatter.ofPattern("[d M yyyy]"))
.append(DateTimeFormatter.ofPattern("[d.M.yyyy]"))
.append(DateTimeFormatter.ofPattern("[d/M/yyyy]"))
.toFormatter();
assertThat(LocalDate.parse("2018 09 10",dateTimeFormatter)).isEqualTo(expectDate);
assertThat(LocalDate.parse("10 9 2018",dateTimeFormatter)).isEqualTo(expectDate);
assertThat(LocalDate.parse("10.09.2018",dateTimeFormatter)).isEqualTo(expectDate);
import { Component, OnInit, OnDestroy } from '@angular/core';
import { MyServiceService } from '../my-service.service';
//import from gt-unsubscribe-on-detroy
import { unsubscribeOnDetroy } from 'gt-unsubscribe-on-detroy';
@Component({
selector: 'app-b',
templateUrl: './b.component.html',
styleUrls: ['./b.component.css']
})