Skip to content

Instantly share code, notes, and snippets.

View tbmreza's full-sized avatar
🎯
Focusing

Reza tbmreza

🎯
Focusing
View GitHub Profile
pisang-train/
pisang-kepok/
kepok-pisang(1).jpg
kepok-manis(45).jpg
pisang-tanduk/
pisang-tanduk(1).jpg
tanduk(45).jpg
pisang-test/
from keras.applications import densenet
from keras.preprocessing import image
from keras.applications.densenet import preprocess_input, decode_predictions
import numpy as np
from keras.layers import Dense, GlobalAveragePooling2D
from keras.preprocessing.image import ImageDataGenerator
from keras.models import Model
from keras.optimizers import Adam
import os
from selenium import webdriver
# path_to_chromedriver = '/home/tbmreza/development/chromedriver_linux64/chromedriver'
browser = webdriver.Chrome('/home/tbmreza/development/chromedriver_linux64/
chromedriver')
browser.get("https://www.google.com/")
# https://www.youtube.com/watch?v=5SlYTF2ovGg&list=PLNtxQuOxJ0p29Ry5jp3AiOJpk0UiSSlts&index=6
import pygame
# Setup
pygame.init()
clock = pygame.time.Clock()
screenSize = (500,500)
screen = pygame.display.set_mode(screenSize)
# Player data
@tbmreza
tbmreza / augment_image.py
Created May 4, 2019 07:07
Image augmentation using imgaug that loads JPG files in working directory and saves to result folder.
# Modified from a stackoverflow answer. https://stackoverflow.com/a/52147997
import imgaug as ia
from imgaug import augmenters as iaa
import numpy as np
import imageio
import os
number_of_output = 4
result_folder = 'imgaug/'
from collections import namedtuple
import re
''' TXT structure sample:
"PROVINSI"(489,185),(652,185),(652,219),(489,219)
"JAWA"(658,185),(747,185),(747,219),(658,219)
"BARAT"(758,185),(866,185),(866,219),(758,219)
"KABUPATEN"(508,220),(704,220),(704,252),(508,252)
"BEKASI"(724,220),(848,220),(848,252),(724,252)
@tbmreza
tbmreza / Modal.svelte
Last active April 4, 2020 15:04
Svelte modal component that can be drawn on top of another.
<script>
export let display;
import ModalInternals from "./ModalInternals.svelte";
let closeModal = false;
const handleClose = () => {
display = false;
};
</script>
export function objectCopy(obj) {
if (typeof obj === "object") {
return JSON.parse(JSON.stringify(obj));
} else {
console.log(obj);
}
}
-- https://www.ma.imperial.ac.uk/~buzzard/xena/natural_number_game/
-- 1. TUTORIAL
-- world=1&level=1 "using refl"
example : forall x : Nat, x = x := by
intro x
exact Eq.refl x
-- world=1&level=2 "using rw"
example
@tbmreza
tbmreza / helpers.go
Last active June 22, 2023 09:11
a growing snippet
func Deref(s *string) string {
if s != nil {
return *s
}
return ""
}
func ParseInt64OrDefault(s string) int64 {
n, strconvErr := strconv.ParseInt(s, 10, 64)
if strconvErr != nil {