Created from the plain text reference card on orgmode.org Download this file, and open it in Emacs org-mode!
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
// ==UserScript== | |
// @name Weiboda Redirection | |
// @name:zh-CN 微博档案真实链接地址重定向 | |
// @description 获取微博档案中的原始链接地址 | |
// @grant none | |
// @run-at document-start | |
// @include *//weibo.wbdacdn.com/url/* | |
// ==/UserScript== |
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
import re | |
import pickle | |
from math import sqrt | |
from operator import itemgetter | |
from collections import defaultdict, Counter | |
import click | |
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
# List unique values in a DataFrame column | |
pd.unique(df.column_name.ravel()) | |
# Convert Series datatype to numeric, getting rid of any non-numeric values | |
df['col'] = df['col'].astype(str).convert_objects(convert_numeric=True) | |
# Grab DataFrame rows where column has certain values | |
valuelist = ['value1', 'value2', 'value3'] | |
df = df[df.column.isin(valuelist)] |
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 | |
# -*- coding: utf-8 -*- | |
""" | |
Author : Linusp | |
Date : 2014/08/30 | |
Description: Linear Regression | |
""" | |
import numpy as np | |
import matplotlib as mpl |
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 | |
# -*- coding: utf-8 -*- | |
""" | |
Author : Linusp | |
Date : 2014/08/30 | |
Description: Simple Perceptron Training | |
""" | |
import numpy as np | |
import matplotlib.pyplot as plt |
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 | |
# -*- coding: utf-8 -*- | |
""" | |
Author : Linusp | |
Date : 2014/08/30 | |
Description: Simple Perceptron Training | |
""" | |
import numpy as np | |
import matplotlib.pyplot as plt |
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
CC_RESET='[00m' | |
CC_WHITE='[1;37m' | |
CC_LIGHT_BLUE='[1;34m' | |
CC_LIGHT_GREEN='[1;32m' | |
CC_LIGHT_RED='[1;31m' | |
function get_git_repos_branch() | |
{ | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1/" | |
} |
NewerOlder