This file contains 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
/* | |
* Easing Functions - inspired from http://gizma.com/easing/ | |
* only considering the t value for the range [0, 1] => [0, 1] | |
*/ | |
EasingFunctions = { | |
// no easing, no acceleration | |
linear: function (t) { return t }, | |
// accelerating from zero velocity | |
easeInQuad: function (t) { return t*t }, | |
// decelerating to zero velocity |
This file contains 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 python | |
# | |
# usage: | |
# conv2vmx-ovf.py some-vm.ovf | |
# | |
# ref: http://www.cnblogs.com/eshizhan/p/3332020.html | |
# | |
import sys | |
fn = sys.argv[1] |
This file contains 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
#!env python3 | |
"""TestResult scorer for MusicID (in-house project).""" | |
import mmap | |
import os | |
import re | |
import sys | |
try: | |
from tqdm import tqdm | |
except ImportError: |
This file contains 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
#!env python3 | |
"""Divide the unknown encoding files to its encoding-named directory.""" | |
from functools import lru_cache | |
import os | |
from chardet.universaldetector import UniversalDetector | |
def detect_encoding(path): | |
"""Using external module 'chardet', detect the encoding and return.""" |
This file contains 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 python2 | |
# coding: utf-8 | |
from __future__ import print_function | |
import sys | |
import re | |
import json | |
import urllib | |
from colorama import init, Fore, Back, Style | |
URL = 'http://csearch.naver.com/dcontent/spellchecker.nhn' |
This file contains 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
echo 'deb http://linux.dell.com/repo/community/ubuntu precise openmanage' | sudo tee -a /etc/apt/sources.list.d/linux.dell.com.sources.list | |
gpg --keyserver pool.sks-keyservers.net --recv-key 1285491434D8786F | |
gpg -a --export 1285491434D8786F | sudo apt-key add - | |
apt-get update | |
apt-get install srvadmin-all | |
vi /opt/dell/srvadmin/sbin/CheckSystemType | |
service dsm_om_connsvc start | |
update-rc.d dsm_om_connsvc defaults |
This file contains 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 boto import config, connect_iam | |
config.add_section('Credentials') | |
prefix = "--------" | |
username = "student" | |
password = "" | |
for i in range(0, 111): | |
idx = "{0:03}".format(i) | |
cred = open(idx) |
This file contains 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 OpenSSL.crypto import load_privatekey, load_certificate, FILETYPE_PEM | |
#from OpenSSL.SSL import SSLv3_METHOD | |
from twisted.internet import reactor | |
from twisted.internet.ssl import CertificateOptions, DefaultOpenSSLContextFactory, DiffieHellmanParameters | |
from twisted.web import proxy, server | |
from twisted.python.filepath import FilePath | |
sample_site = server.Site(proxy.ReverseProxyResource('localhost', 80, '')) # ignore it. | |
# AES256-SHA |
This file contains 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
#!py3env/bin/python | |
import os | |
import re | |
import sys | |
import a_href | |
##############################################3 | |
from html.parser import HTMLParser |
This file contains 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
class Action(ActionMixIn, db.Model): | |
__bind_key__ = __tablename__ = "action" | |
class Action_01_NotResponsed_ByMe(Action): | |
__bind_key__ = "action" | |
__tablename__ = "Action_01_NotResponsed_ByMe".lower() | |
id = db.Column(db.Integer, db.ForeignKey('action.id'), primary_key=True) |
OlderNewer