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
# IPsec in Cent OS7 | |
https://github.com/travislee8964/L2TP-VPN-installation-script-for-CentOS-7 | |
# Shadowsocks auto install |
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
var url = ""; | |
var PUZZLE_DIFFICULTY_x = 4; | |
var PUZZLE_DIFFICULTY_y = 4; | |
var PUZZLE_HOVER_TINT = '#009900'; | |
var _canvas; | |
var _stage; | |
var _img; |
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 __future__ import division | |
import copy | |
import math | |
import pyPdf | |
import sys,os | |
# import pyPdf.generic.RectangleObject as rr | |
def split_pages(src, dst): | |
src_f = file(src, 'r+b') |
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
//:# Playground - TrueType Font Analysis | |
import Cocoa | |
import XCPlayground | |
var char: Character = "书" | |
var font = CTFontCreateWithName("Weibei SC", 100, nil) | |
func findGlyph(str: String, font: CTFont) -> CGGlyph { |
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 | |
} |
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
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/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
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/env ruby | |
# Codeset changing methods | |
begin | |
require 'rchardet' | |
rescue LoadError | |
end | |
module CodesetChange |
OlderNewer