This file contains hidden or 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
# 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' |
This file contains hidden or 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
#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 | |
* | |
* 比较两个字符串的相似程度 |
This file contains hidden or 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
# gcc -Wall -o match match.c && ./match | |
# | |
#include <stdio.h> | |
#include <string.h> | |
#include <regex.h> | |
This file contains hidden or 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
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; |
This file contains hidden or 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
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
" 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") |
This file contains hidden or 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
// ---------- 一些排序算法 | |
var Sort = {} | |
Sort.prototype = { | |
// 利用sort进行排序 | |
systemSort:function(array){ | |
return array.sort(function(a, b){ | |
return a - b; | |
}); | |
}, | |
This file contains hidden or 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
<?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. |
This file contains hidden or 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
# 放置在 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/ { |