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
These two files should help you to import passwords from mac OS X keychains to 1password. | |
Assumptions: | |
1) You have some experience with scripting/are a power-user. These scripts worked for me | |
but they haven't been extensively tested and if they don't work, you're on your own! | |
Please read this whole document before starting this process. If any of it seems | |
incomprehensible/frightening/over your head please do not use these scripts. You will | |
probably do something Very Bad and I wouldn't want that. | |
2) You have ruby 1.9.2 installed on your machine. This comes as standard with Lion, previous | |
versions of OS X may have earlier versions of ruby, which *may* work, but then again, they |
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 | |
import shutil, os, sys | |
# current working directory | |
dest_dir = os.getcwd() | |
dir = [] | |
for root, dirs, files in os.walk(dest_dir): | |
for name in files: |
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 multiprocessing import Pool, Manager | |
import yaml | |
import re | |
import math | |
from count import Count | |
from statistic import MI, LogLikelihood | |
import jieba | |
n_workers = 16 |
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 python3 | |
import os, argparse, logging | |
# get cpu cores | |
import multiprocessing | |
# doc2vec | |
from gensim.models import Doc2Vec | |
from gensim.models.doc2vec import LabeledSentence | |
from gensim import utils | |
# array storage |
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 python3 | |
import requests, json, sys, random | |
from html.parser import HTMLParser | |
from time import sleep | |
from tqdm import tqdm | |
import cProfile | |
url = 'http://words.sinica.edu.tw/ftms-bin/scripts/words_scripts/zizi1.pl' |
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 gensim.models.doc2vec import Doc2Vec | |
from gensim.test.test_doc2vec import ConcatenatedDoc2Vec | |
from sklearn.linear_model import LogisticRegression, SGDClassifier, LogisticRegressionCV | |
from sklearn import svm | |
from sklearn.externals import joblib | |
import jieba | |
import numpy as np | |
import logging | |
import os | |
import sys |
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 python3 | |
import os, sys, argparse, logging | |
baseline = '/tmp2/b03902036/train-punc.pro' | |
result = '/tmp2/b03902036/result.cmb' | |
ground_truth = dict() | |
with open(baseline, 'r') as in_file : | |
for line in in_file : |
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 python3 | |
import os, argparse, logging | |
# using doc2vec model | |
from gensim.models import Doc2Vec | |
# generate compressed pickle file | |
import pickle, numpy, gzip | |
logging.basicConfig(format='%(asctime)s [%(levelname)s] %(message)s') |
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
''' | |
A fork of this gist https://gist.github.com/BigglesZX/4016539 . | |
Ported to Python3 and verify it with Pillow. | |
''' | |
import argparse | |
import os | |
from PIL import Image | |
def find_dir(path): |
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
#!/bin/bash | |
echo "" | |
read -e -p "Target folder name: " folder | |
echo "Duplicate folder structure of $folder.." | |
if [ -d "Compressed-${folder}" ]; then | |
echo "" | |
read -r -p "\"Compressed-${folder}\" exist, overwrite? [y/n] " response | |
if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]] |
OlderNewer