This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(load-theme 'tango-dark) | |
(global-linum-mode 1) | |
(setq linum-format "%3d \u2502 ") | |
(electric-pair-mode 1) | |
(setq backup-directory-alist | |
`(("." . ,(concat user-emacs-directory "backups")))) | |
(setq auto-save-file-name-transforms |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"flag" | |
"fmt" | |
"io" | |
"net" | |
) | |
var localAddress *string = flag.String("l", "localhost:9999", "Local address") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env lua | |
-- login.lua auto login XJTU student network | |
-- Prerequisite: luasocket, luaposix | |
info = { | |
username = 'THIS IS USERNAME'; | |
password = 'THIS IS PASSWORD'; | |
} | |
string.split = function (pString, pPattern) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
'Get LINE Sticker' | |
import requests | |
import re | |
import os | |
import shutil | |
from urllib.parse import urlparse | |
from bs4 import BeautifulSoup |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Codeset changing methods | |
begin | |
require 'rchardet' | |
rescue LoadError | |
end | |
module CodesetChange |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'io/console' | |
# Reads keypresses from the user including 2 and 3 escape character sequences. | |
def read_char | |
STDIN.echo = false | |
STDIN.raw! | |
input = STDIN.getc.chr | |
if input == "\e" then | |
input << STDIN.read_nonblock(3) rescue nil |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/osascript | |
set change to true -- if you need change the Contacts, toggle it to TRUE | |
(*turn Chinese characters to pinyin*) | |
on pinyin(chars) | |
(*python3 pypinyin needed*) | |
return do shell script "echo '"&chars&"' | /usr/local/bin/python3 -c 'from pypinyin import pinyin, lazy_pinyin;print(\"\".join([a.capitalize() for a in lazy_pinyin(input())]))'" | |
end | |
tell application "Contacts" | |
(*get every person of Contact*) | |
set persons to people |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from requests import request | |
from pprint import pprint as p | |
import re, json | |
"GitHub API Python" | |
import configparser | |
config = configparser.ConfigParser() | |
config.read('config.txt') | |
API = config['github']['api'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
$files = STDIN.read | |
randir = (0...31).map { (65 + rand(26)).chr }.join | |
class String | |
def black; "\e[30m#{self}\e[0m" end | |
def red; "\e[31m#{self}\e[0m" end | |
def green; "\e[32m#{self}\e[0m" end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Install Shadowsocks on CentOS 7 | |
echo "Installing Shadowsocks..." | |
random_string() | |
{ | |
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w ${1:-32} | head -n 1 | |
} |
NewerOlder