Skip to content

Instantly share code, notes, and snippets.

View able8's full-sized avatar

Able Lv able8

View GitHub Profile
@wynemo
wynemo / fapiao.py
Created October 9, 2017 08:52
计算某目录下电子发票总金额
#!/usr/bin/env python
#coding:utf-8
#sudo yum install poppler-utils
import os
import re
import subprocess
from decimal import *
@posener
posener / go-shebang-story.md
Last active July 28, 2025 07:58
Story: Writing Scripts with Go

Story: Writing Scripts with Go

This is a story about how I tried to use Go for scripting. In this story, I’ll discuss the need for a Go script, how we would expect it to behave and the possible implementations; During the discussion I’ll deep dive to scripts, shells, and shebangs. Finally, we’ll discuss solutions that will make Go scripts work.

Why Go is good for scripting?

While python and bash are popular scripting languages, C, C++ and Java are not used for scripts at all, and some languages are somewhere in between.

@jgamblin
jgamblin / godaddydns.sh
Created July 12, 2017 11:11
Shell Script To Automatically Create A DNS A Record in Godaddy.
#!/bin/bash
DOMAIN=jgamblin.com
RECORD_NAME=newproject
GODADDY_API_KEY=(Get from devloper.godaddy.com)
GODADDY_API_SECRET=(Get from devloper.godaddy.com)
# Get IP Address
IP=`dig +short myip.opendns.com @resolver1.opendns.com`
# Create DNS A Record
@able8
able8 / Export Notes.AppleScript
Created May 16, 2017 08:34
Export Apple Notes via AppleScript
tell application "TextEdit"
activate
make new document
end tell
tell application "Notes"
if folder "Archive" exists then
set output to ""
repeat with aNote in notes in folder "Archive"
@zxhfighter
zxhfighter / vscode-ts-snippet.md
Last active October 26, 2018 03:59
vscode 配置说明

vscode 配置概览

[TOC]

作为一个 sublime text 重度依赖用户,初次迁移到 vscode 还是有些不太适应,这里记录一下一些常见的配置。

extension

安装的 extension 如下:

@sfwn
sfwn / 0 gc-step.md
Last active June 7, 2023 13:06
docker registry cleanup script : just reserve most recently 5 images per repo

you need jq first.

Steps:

  1. download the script && chmod +x
  2. enable "delete" inside docker registry container
/etc/docker/registry/config.yml

storage:
 delete:
@montanaflynn
montanaflynn / pget.go
Last active January 17, 2025 17:07
Bounded Parallel Get Requests in Golang
package main
import (
"fmt"
"net/http"
"sort"
"time"
)
// a struct to hold the result from each request including an index
@cep21
cep21 / httptrace_example.go
Last active July 28, 2023 15:23
Example of http trace in Go 1.7
package main
import (
"fmt"
"io"
"net/http"
"net/http/httptest"
"net/http/httptrace"
"os"
)