Skip to content

Instantly share code, notes, and snippets.

# Taken from https://github.com/leandrotoledo/python-telegram-bot/blob/master/telegram/emoji.py
"""This module contains a object that represents an Emoji"""
class Emoji(object):
"""This object represents an Emoji."""
GRINNING_FACE_WITH_SMILING_EYES = b'\xF0\x9F\x98\x81'
FACE_WITH_TEARS_OF_JOY = b'\xF0\x9F\x98\x82'
@zivee
zivee / jarowinkler_distance.c
Created May 20, 2018 16:48 — forked from neesenk/jarowinkler_distance.c
比较两个字符串的相似程度Jaro–Winkler距离
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
/**
* Jaro–Winkler distance
* http://en.wikipedia.org/wiki/Jaro%E2%80%93Winkler_distance
*
* 比较两个字符串的相似程度
@zivee
zivee / match.c
Created January 25, 2017 08:26 — forked from ianmackinnon/match.c
C Regex multiple matches and groups example
# gcc -Wall -o match match.c && ./match
#
#include <stdio.h>
#include <string.h>
#include <regex.h>
@zivee
zivee / phpapp.conf
Last active November 11, 2015 09:13
yaf框架nginx配置
server {
listen 80;
server_name sso.local;
root /path/yaf/public;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ \.php$ {
try_files $uri =404;
@zivee
zivee / my_configs.vim
Last active January 1, 2016 08:37
Ubuntu 14.04下GVIM的字体间距过宽和显示GBK中文的设置
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Important:
" This requries that you install https://github.com/amix/vimrc !
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set encoding=utf-8
"set fileencoding=chinese
set fileencodings=ucs-bom,utf-8,chinese
set ambiwidth=double
if has("linux")
@zivee
zivee / sort.js
Last active December 27, 2015 08:59
Javascript的各种排序算法实现,转自某位牛人
// ---------- 一些排序算法
var Sort = {}
Sort.prototype = {
// 利用sort进行排序
systemSort:function(array){
return array.sort(function(a, b){
return a - b;
});
},
<?php
/**
* SplClassLoader implementation that implements the technical interoperability
* standards for PHP 5.3 namespaces and class names.
*
* http://groups.google.com/group/php-standards/web/final-proposal
*
* // Example which loads classes for the Doctrine Common package in the
* // Doctrine\Common namespace.
@zivee
zivee / gist:6737560
Created September 28, 2013 01:52
使用nginx作为tornado的反向代理服务器的配置
# 放置在 http 域下
upstream tornadobackends {
server 127.0.0.1:8000 max_fails=3 fail_timeout=1s;
server 127.0.0.1:8001 max_fails=3 fail_timeout=1s;
server 127.0.0.1:8002 max_fails=3 fail_timeout=1s;
server 127.0.0.1:8003 max_fails=3 fail_timeout=1s;
}
# 放置在 server 域下
location /api/ {