Skip to content

Instantly share code, notes, and snippets.

View chengdujin's full-sized avatar

Yuan JIN chengdujin

View GitHub Profile
// _ooOoo_
// o8888888o
// 88" . "88
// (| -_- |)
// O\ = /O
// ____/`---'\____
// . ' \\| |// `.
// / \\||| : |||// \
// / _||||| -:- |||||- \
// | | \\\ - /// | |
@chengdujin
chengdujin / SubStringExtension.swift
Last active August 29, 2015 14:02
An extension to Swift's String so that it supports getting/setting a substring with a Range
import Foundation
// extension to String so that it supports Python-like substring extraction
extension String {
subscript(range: Range<Int>) -> String {
get {
let location = range._startIndex
let length = range._endIndex - range._startIndex + 1
return self.bridgeToObjectiveC().substringWithRange(NSMakeRange(location,length))
}
@chengdujin
chengdujin / projects_links_revisit
Last active October 9, 2016 03:32
Projects and Links That are Worth Revisiting
@chengdujin
chengdujin / mnews-gpm_importants-before-kickoff
Created July 5, 2013 15:48
mnews-gpm_importants-before-kickoff
需要渔樵配合的
-------------
#### Kickoff时间确定 ####
- 现在的Hao123停止开发时间确定(因为需要在现有Hao123上面进行修改)
- 能否7月14号开始
#### KPI设定 ####
- 延续Hao123的KPI? - 即“新增用户4周留存率到20%”
#### 定义清楚权限 ####
@chengdujin
chengdujin / gpm-mnews_important
Created July 5, 2013 15:31
mnews-gpm_importants-before-kickoff
需要渔樵配合的
-------------
#### Kickoff时间确定 ####
- 现在的Hao123停止开发时间确定
- 是否7月7-12号内开始
#### KPI设定 ####
- 延续Hao123的KPI? - 即“新增用户4周留存率到20%”
#### 权限定义清楚 ####
@chengdujin
chengdujin / feed_scraper.py
Created March 3, 2012 16:39
using google reader's api (goolge oauth2), fetching specific number of feeds. the number is theoretically unlimited
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
# this script serves to fetch all of a provider's feeds (a limit
# for the historical feeds would be 5000). and then the feeds are
# stored in mongodb
#
# @author Yuan JIN
# @contact chengudjin@gmail.com
@chengdujin
chengdujin / twitter_analyst.py
Created March 2, 2012 18:16
repeatedly retrieve all the tweets of one user. maximum 3200, limited by twitter api
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
# this script serves to retrieve all the tweets of a user, and
# do some text mining based on the data
#
# @author Yuan JIN
# @contact chengdujin@gmail.com
# @since 2012.03.01
@chengdujin
chengdujin / hn_item_builder.py
Created March 2, 2012 18:11
simply pull hacker news items from the api, 30 items/one pull. and update news against old ones in mongodb
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
# this script serves to grab the latest items in the hacker news
# stream, and store them into the mongodb
#
# @author Yuan JIN
# @contact chengdujin@gmail.com
# @since 2012.02.29
@chengdujin
chengdujin / twitter_monitor.py
Created March 2, 2012 17:42
twitter monitoring and automatic posting tweets with specific hashtag to wordpress via xml-rpc
#!/usr/bin/python
# -*- coding: utf-8 -*
##
# this script serves to monitor the registered user twitter account,
# and publish certain tweets back to the project blog
#
# @author Yuan JIN
# @contact chengdujin@gmail.com
# @since 2012.03.02