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/
{" ": " \t \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u205f\u3000",
"A": "\u0391A\u00c0\u0410\u00c1\u1e00\u1f08\u1f09\u1f0a\u1f0b\u1f0c\u1fb8\u1fb9\u1fba\u1fbb\u1f0d\u1f0e\u1f0f\u1ea0\u1ea2\u1ea4\u1ea6\u1ea8\u1eaa\u1eac\u1eae\u1eb0\u1eb2\u1eb4\u1eb6\u00c2\u00c3\u00c4\u00c5\u0100\u0102\u0104\u01cd\u01de\u01e0\u01fa\u0202\u0226\u24b6\ud83c\udd50\uff21\ud835\udc00\ud835\udd6c\ud835\udc68\ud835\udcd0\ud835\udd38\ud835\ude70\ud835\udda0\ud835\uddd4\ud835\ude3c\ud835\ude08\ud83c\udd30\ud83c\udd70\u00c1\ud835\udd04\u00c4\u1d00\u023a\u2090\u1d2c",
"B": "B\u0392\u03b2\u00df\u1e02\u1e04\u1e06\u0412\u0181\u24b7\ud83c\udd51\uff22\ud835\udc01\ud835\udd6d\ud835\udc69\ud835\udcd1\ud835\udd39\ud835\ude71\ud835\udda1\ud835\uddd5\ud835\ude3d\ud835\ude09\ud83c\udd31\ud83c\udd71B\ud835\udd05\u1e04\u0299\u0243\u1d2e",
"C": "C\u0421\u216d\u2103\u00c7\u0106\u0108\u010a\u010c\u1e08\u0187\u24b8\ud83c\udd52\uff23\ud835\udc02\ud835\udd6e\ud835\udc6a\ud835\udcd2\u2102\ud835\ude72\ud835\udda2\ud835\uddd6\
# 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?"))