Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

guodong guodong000

🏠
Working from home
View GitHub Profile
@guodong000
guodong000 / pyenv-relink.md
Last active Jan 3, 2021
Add system python to pyenv
View pyenv-relink.md
@guodong000
guodong000 / Teamviewer ID Change
Last active Nov 22, 2019
Change Teamviewer ID to unlock (Python 2)
View Teamviewer ID Change
#!/usr/bin/env python
#coding:utf-8
import sys
import os
import glob
import platform
import re
import random
import string
View 语法分析标注.md
ROOT:要处理文本的语句
IP:简单从句
NP:名词短语
VP:动词短语
PU:断句符,通常是句号、问号、感叹号等标点符号
LCP:方位词短语
PP:介词短语
CP:由‘的’构成的表示修饰性关系的短语
DNP:由‘的’构成的表示所属关系的短语
@guodong000
guodong000 / jieba词性标记.md
Last active Sep 22, 2021
jieba分词词性标记
View jieba词性标记.md
a 形容词 (取英语形容词 adjective 的第 1 个字母。)
  ad 副形词 (直接作状语的形容词,形容词代码 a 和副词代码 d 并在一起。)
  ag 形容词性语素 (形容词性语素,形容词代码为 a,语素代码 g 前面置以 a。)
  an 名形词 (具有名词功能的形容词,形容词代码 a 和名词代码 n 并在一起。)
b 区别词 (取汉字「别」的声母。)
c 连词 (取英语连词 conjunction 的第 1 个字母。)
d 副词 (取 adverb 的第 2 个字母,因其第 1 个字母已用于形容词。)
  df 副词*
  dg 副语素 (副词性语素,副词代码为 d,语素代码 g 前面置以 d。)
@guodong000
guodong000 / uitextview-limit-length.m
Last active Sep 13, 2016
限制UITextView的最大文字长度
View uitextview-limit-length.m
#define MAX_LENGTH 15 // Whatever your limit is
- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text
{
NSUInteger newLength = (textView.text.length - range.length) + text.length;
if(newLength <= MAX_LENGTH)
{
return YES;
} else {
NSUInteger emptySpace = MAX_LENGTH - (textView.text.length - range.length);
textView.text = [[[textView.text substringToIndex:range.location]
View UIImage+Snapshot.m
+ (UIImage *)snapshotView:(UIView *)view {
UIGraphicsBeginImageContextWithOptions(view.frame.size, NO, [[UIScreen mainScreen] scale]); //0
[view drawViewHierarchyInRect:view.frame afterScreenUpdates:YES];
UIImage *snapshot = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return snapshot;
}
+ (UIImage *)snapshot {
CGSize imageSize = CGSizeZero;
@guodong000
guodong000 / source-map-unpacker.js
Created Jun 28, 2016 — forked from zxbodya/source-map-unpacker.js
script to extract sources, from sourcesContent field in sourcemap
View source-map-unpacker.js
'use strict';
var fs = require('fs');
var maps = [
fs.readFileSync('./main.xxxx.js.map'),
fs.readFileSync('./1.chunk.xxxx.js.map'),
fs.readFileSync('./2.chunk.xxxx.js.map'),
fs.readFileSync('./3.chunk.xxxx.js.map')
];
@guodong000
guodong000 / universal-framework.sh
Created Jun 21, 2016 — forked from cromandini/universal-framework.sh
This run script will build the iphoneos and iphonesimulator schemes and then combine them into a single framework using the lipo tool (including all the Swift module architectures).
View universal-framework.sh
#!/bin/sh
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal
# make sure the output directory exists
mkdir -p "${UNIVERSAL_OUTPUTFOLDER}"
# Step 1. Build Device and Simulator versions
xcodebuild -target "${PROJECT_NAME}" ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build
xcodebuild -target "${PROJECT_NAME}" -configuration ${CONFIGURATION} -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build
View gist:1e2ecd2ee01630374efa36dc67f631fd
ACTION = build
AD_HOC_CODE_SIGNING_ALLOWED = NO
ALTERNATE_GROUP = staff
ALTERNATE_MODE = u+w,go-w,a+rX
ALTERNATE_OWNER = grantdavis
ALWAYS_SEARCH_USER_PATHS = NO
ALWAYS_USE_SEPARATE_HEADERMAPS = YES
APPLE_INTERNAL_DEVELOPER_DIR = /AppleInternal/Developer
APPLE_INTERNAL_DIR = /AppleInternal
APPLE_INTERNAL_DOCUMENTATION_DIR = /AppleInternal/Documentation
@guodong000
guodong000 / 词性标记.md
Created Jun 15, 2016 — forked from luw2007/词性标记.md
词性标记: 包含 ICTPOS3.0词性标记集、ICTCLAS 汉语词性标注集、jieba 字典中出现的词性、simhash 中可以忽略的部分词性
View 词性标记.md

词的分类

  • 实词:名词、动词、形容词、状态词、区别词、数词、量词、代词
  • 虚词:副词、介词、连词、助词、拟声词、叹词。

ICTPOS3.0词性标记集

n 名词
	nr 人名