Skip to content

Instantly share code, notes, and snippets.

View hephyr's full-sized avatar

Zephyr hephyr

View GitHub Profile
package main
import "fmt"
func factorial_iter(product, counter, max_count int) int {
if counter > max_count {
return product
} else {
return factorial_iter(counter*product, counter+1, max_count)
}
@hephyr
hephyr / HeapSort.go
Last active November 3, 2018 05:22
Basic Sort Algorithm in Go
package main
import (
"fmt"
"math/rand"
"time"
)
func MaxHeaplify(a []int, i, len int) {
left := 2*i + 1
@hephyr
hephyr / GoogleContactsAdd+86.go
Created July 27, 2018 03:30
Export contacts in Google Contacts as csv file, then add +86 for the phone numbers
package main
import (
"encoding/csv"
"os"
"strings"
)
func main() {
file, err := os.Open("google.csv")
@hephyr
hephyr / netlogin.py
Created October 2, 2017 14:43
济南大学联通网登录
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import urlparse
import requests
def getURL():
url = 'http://www.163.com'
@hephyr
hephyr / download_my_pixiv_bookmarks.py
Last active February 16, 2019 12:26
Download the pictures in your Pixiv bookmarks.
# -*- coding: utf-8 -*-
import os
import time
from pixivpy3 import *
from multiprocessing import Pool
api = AppPixivAPI()
username = 'account'
password = 'password'
path = u'your path'
@hephyr
hephyr / download_google_calendar_illustrations.py
Last active November 11, 2018 07:25
Download Google Calendar illustrations
# -*- coding: utf-8 -*-
import os
import requests
import shutil
keywords = {
'art': ['painting', 'art workshop', 'sketching workshop', 'drawing workshop'],
'badminton': ['badminton'],
'baseball': ['baseball'],
'basketball': ['basketball'],
@hephyr
hephyr / make_blur_wallpaper.py
Created May 22, 2017 01:31
Make blur wallpaper
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from imghdr import what
from sys import argv
from getopt import getopt
from PIL import Image, ImageFont, ImageFilter
use_help = '''getwallpaper [-h] source'''