Skip to content

Instantly share code, notes, and snippets.

View blueset's full-sized avatar

Eana Hufwe blueset

View GitHub Profile
@blueset
blueset / LRC translation combiner
Last active August 29, 2015 14:17
An LRC translation combiner. Helping LRC makers combining their lyrics translations easier. Available in English and Chinese at http://1a23.com/lyrictool/ .
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link href='http://fonts.googleapis.com/css?family=Roboto:400,300' rel='stylesheet' type='text/css'>
<title>LRC_translation_conbiner. by Eana Hufwe</title>
</head>
<body>
<style>
body{
@blueset
blueset / script.js
Created May 2, 2015 10:54
Netease LRC Translate Extractor 网易云音乐翻译提取脚本
/*
使用方法:
在浏览器中打开JS终端,作用范围定位到contentFrame。
将divider改成区分翻译的符号。
然后将以下代码粘贴执行。
协议:MIT
*/
var divider = " / ";
@blueset
blueset / README.md
Last active August 29, 2015 14:20
AJINC Attendance checker

AJINC Attendance checker

This is an attendance checker dedicated to AJINC. When running it, it sends a notice to your Pushbullet account with your attendance status of the day.

Recommended usage

It is recommended to run this script as a corn job every work day at around 0930, as your attendance is most likely confirmed by then.

Suggested cronjob line:

30 9 * * 1-5 python3 /path/to/script/ajinc_attendance.py
@blueset
blueset / remove_netease_tags.py
Created May 15, 2015 13:30
Remove Netease Music Tags
'''
删除网易云音乐嵌在音乐里面的参数。使其将音乐文件识别为外部文件。
(目前只是直接删除COMM标签。)
Requirements:
Mutagen
License: MIT
'''
@blueset
blueset / 20150615 V2EX 01 t_198719.sql
Last active August 29, 2015 14:23
Github Pastebin
SELECT title, content, category, pub_time
FROM news
WHERE (
SELECT count(*) FROM news AS f
WHERE f.category = news.category AND f.pub_time <= news.pub_time
) <= 2;
# Via http://www.xaprb.com/blog/2006/12/07/how-to-select-the-firstleastmax-row-per-group-in-sql/
# Translation of https://gist.github.com/MHeasell/bb9f7253da45b5140a83
def vadd (s, o):
return {'x': s['x']+o['x'], 'y': s['y']+o['y']}
def vsub (s, o):
return {'x': s['x']-o['x'], 'y': s['y']-o['y']}
def vmul (s, o):
return {'x': s['x']*o, 'y': s['y']*o}
def vlen (s):
return (s['x']**2+s['y']**2)**0.5
@blueset
blueset / lrc_utf-8.py
Created November 11, 2015 02:40
Convert all *.lrc files in current directory to UTF-8 encoding.
#!/usr/local/bin/python3
# Convert all *.lrc files in current directory to UTF-8 encoding.
__author__ = 'Eana Hufwe <ilove@1a23.com>'
import glob
from chardet.universaldetector import UniversalDetector
detector = UniversalDetector()
import shutil
@blueset
blueset / comic-translations.md
Created December 17, 2015 12:17
Comic Translations

Superman and Facebook

Android and Motorola

La Chine

Author: the Joy of Tech by Nitrozac and Snaggy

@blueset
blueset / orders.py
Created December 23, 2015 12:17
To Bryan 201512230001
orders = []
for i in range(10):
purpose = raw_input("Would you like to buy or sell?")
if purpose not in ['buy', 'sell']:
print("You don't anyhow ah.")
exit()
try:
price = float(raw_input("At what price would you like to buy/sell?"))
quantity = float(raw_input("What is the quantity you would like to buy/sell?"))
@blueset
blueset / keybase.md
Created February 21, 2016 02:10
keybase

Keybase proof

I hereby claim:

  • I am blueset on github.
  • I am blueset (https://keybase.io/blueset) on keybase.
  • I have a public key ASDlmdWfmOfm5sOK2jEMR2S8dCjDaVdgBbiIxQovia_apwo

To claim this, I am signing this object: