Skip to content

Instantly share code, notes, and snippets.

View theo-l's full-sized avatar
🎯
Focusing

liang.guisheng theo-l

🎯
Focusing
  • Sao Paulo
View GitHub Profile

趣玩茶 API 文档

登录页面

发送验证码

  • Endpoint:

    POST /api/v1/verification-code/request-code/

@theo-l
theo-l / md5_check_file.py
Created July 4, 2016 20:34
using python to check file's md5sum value
#!/usr/bin/python
# -*- coding=utf-8 -*-
import hashlib
def md5sum(filename, blocksize=65536):
hash = hashlib.md5()
with open(filename,'rb') as f:
for block in iter(f.readlines()):
hash.update(block)
@theo-l
theo-l / FileDetail.py
Created July 4, 2016 20:06
return the detail description of a file
#!/usr/bin/python
# -*- coding=utf-8 -*-
import os
import datetime
class FileDetail:
def __init__(self, filename):
@theo-l
theo-l / StreamEmulationTest.java
Created April 1, 2016 18:29
This class is used emulate the Stream feature in java 8
package test.methodref;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Comparator;
import java.util.List;
import java.util.Optional;
import java.util.function.Consumer;
import java.util.function.Function;
@theo-l
theo-l / init.coffee
Created March 11, 2016 16:47
the initiate script file for atom
SymbolRegex = /[)}>\]'";]/
atom.commands.add 'atom-text-editor', 'custom:jump-over-symbol': (event) ->
editor = atom.workspace.getActiveTextEditor()
cursorMoved = false
for cursor in editor.getCursors()
range = cursor.getCurrentWordBufferRange(wordRegex: SymbolRegex)
unless range.isEmpty()
cursor.setBufferPosition(range.end)
cursorMoved = true
event.abortKeyBinding() unless cursorMoved
@theo-l
theo-l / kepmap.cson
Created March 11, 2016 16:46
the kepmap file for atom using vim-mode
'atom-text-editor:not([mini])':
'tab': 'custom:jump-over-symbol'
'atom-text-editor.vim-mode:not(.insert-mode)':
', b': 'vim-mode:move-to-beginning-of-line'
', e': 'vim-mode:move-to-last-character-of-line'
'body':
'ctrl-l': 'pane:show-next-item'
'ctrl-h': 'pane:show-previous-item'
[
//sublime_jedi mousemap configuration
//let ctrl+Left click for goto function definition
{
"modifiers": ["ctrl"], "button": "button1",
"command": "sublime_jedi_goto",
"press_command": "drag_select"
[
//sublime_jedi
//g+f used to goto funcition definition
{"keys":["g","f"],"command": "sublime_jedi_goto"},
//g+d used to show docstring
{"keys":["g","d"], "command": "sublime_jedi_docstring"}
]
{
//------sublime_jedi.sublime-settings
"auto_complete_function_params":"all",//optional value "all",""
// "sublime_completions_visibility":"default/jedi/list", //don't care if we have SublimeAllCompletion
"logging_level": "error",
"sublime_jedi_docstring":"F1",
{
"auto_complete_selector": ".",
"auto_complete_triggers":
[
{
"characters": ".",
"selector": "source.python"
}
],
"caret_style": "phase",