Skip to content

Instantly share code, notes, and snippets.

View khajer's full-sized avatar

itsara khajer

View GitHub Profile
/*
*
***
*****
*******
*********
***********
*********
*******
*****
@khajer
khajer / main.go
Created June 5, 2018 10:01
gen star
/*
*
***
*****
*******
*********
***********
*********
*******
*****
from datetime import datetime, timedelta
import random
def main():
print "generate time attendant"
for i in range(30):
t = random.randrange(45)
dStart = datetime(2009, 1, 6, 9, t+15, 24, 78915)
package main
import (
"fmt"
"time"
"math/rand"
)
func main() {
fmt.Println("generate time in/out")
@khajer
khajer / json2struct_go.go
Last active September 28, 2018 09:29
json string 2 struct golang
/*
final output
type Simple struct {
Status string `json:"status"`
Message string `json:"message"`
Test float64 `json:"test"`
Test1 float64 `json:"test1"`
Ar []string `json:"ar"`
type Result struct {
Eligible float64 `json:"eligible"`
@khajer
khajer / reduce_alpha_image.py
Created February 18, 2019 04:28
reduce alpha image
from PIL import Image
arImg = [
"android_128_px.png",
"apache_128_px.png",
"coupon_128_px.png",
"graphs_128_px.png",
"lab_128_px.png",
@khajer
khajer / recursive-show -file-folder.py
Created January 4, 2024 05:06
recursive-show -file-folder.py
import os
def listfilepath(space, path):
lst = os.listdir(path)
for f in lst:
if os.path.isdir(path+"/"+f):
print(space, "[folder]:", f)
listfilepath(space+" ", path+"/"+f)
else:
print(space, "file:", f)