Skip to content

Instantly share code, notes, and snippets.

View linw1995's full-sized avatar
🎯
Focusing

林玮 (Jade Lin) linw1995

🎯
Focusing
View GitHub Profile
@linw1995
linw1995 / Packaging fonts in configuration profiles for installing on iOS.py
Created June 16, 2017 12:29
Packaging fonts in configuration profiles for installing on iOS
# coding: utf-8
import re
import hashlib
import sys
from base64 import b64encode
from random import choice
items = ['8', '9', 'a', 'b']
names = sys.argv
@linw1995
linw1995 / main.py
Last active December 12, 2023 07:51
A simple example shows how to hook response with mitmproxy in script.
# Standard Library
import asyncio
import contextlib
from pathlib import Path
from typing import Callable, Optional
# Third Party Library
import httpx
@linw1995
linw1995 / WaterMark.go
Last active February 8, 2023 06:48
Using golang to mark the picture
package main
import (
"bytes"
"fmt"
"strings"
"io/ioutil"
"os"
"path"
@linw1995
linw1995 / day.go
Created August 27, 2021 02:37
get begin time and end time in Golang.
package main
import (
"fmt"
"time"
)
func main() {
now := time.Now()
fmt.Println(
@linw1995
linw1995 / clip_magic.py
Created March 29, 2022 07:24
IPython magic for copying into clipboard in zsh shell on macOS.
from IPython.core.magic import needs_local_scope, register_line_magic
@register_line_magic
@needs_local_scope
def clip(line, local_ns):
import json
import os
import subprocess

Usage

python tailwind_auto_prefix.py <tailwind_template.html
@linw1995
linw1995 / main.go
Created October 14, 2021 13:46
json.Unmarshal can parse null into empty array
package main
import (
"fmt"
"encoding/json"
)
func main() {
var (
lst []string
@linw1995
linw1995 / main.py
Created October 14, 2021 13:44
Use sshfs to mount directory of MacOS into podman machine.
"""
https://github.com/containers/podman/issues/8016#issuecomment-920015800
"""
import getpass
import os
import re
import shlex
import subprocess
from pathlib import Path
@linw1995
linw1995 / go.mod
Last active September 7, 2021 03:00
Get keyValue history of ETCD in golang.
module github.com/linw1995/etcd_learning
go 1.16
replace (
github.com/coreos/bbolt => go.etcd.io/bbolt v1.3.6
google.golang.org/grpc => google.golang.org/grpc v1.26.0
)
require (
@linw1995
linw1995 / csv.go
Created August 20, 2021 09:54
Golang read csv data row into struct
package main
import (
"bytes"
"encoding/csv"
"fmt"
"io"
"reflect"
)