Skip to content

Instantly share code, notes, and snippets.

View apua's full-sized avatar
💭
Seeking next epic moment

Apua Juan apua

💭
Seeking next epic moment
View GitHub Profile
@apua
apua / gist:8538971
Last active January 3, 2016 23:59
whatever I have to test
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
class PythonConference(AbstractConference):
'''from everything import future'''
def call_for_proposal(self):
'''只要您有任何與 Python 相關之應用或研究, 歡迎提出議程分享'''
self.listen_proposals(target=self.queue, deadline=self.講題徵求截止日)
PyConAPAC2014 = PythonConference(
活動全名 = "Python Conference APAC 2014" ,
@apua
apua / gist:b6f1c28ff9d9ccc9b38b
Created December 30, 2014 14:19
Comparison between "import statement", "__import__ function", and "import_module function"
from importlib import import_module
# Absolute Imports
# ================
# import <>
import package_A.module_m as m
class Color:
def format(self, s, color='org', indent=0):
'''
:type s: str
:param s: message
:param color: predefined color name, e,g,: red, RED.
Using 'l' prefix for bright color, e.g.: lred, lwhite.
It's case-insensitive.
'''
COLOR_TEMPLATE = "\33[{}m"
module Main where
import Criterion.Main
import qualified Data.ByteString as S
import Data.ByteString (ByteString)
import Data.ByteString.Char8 (unpack)
--------------------------------------------------------------------------------
-- Apua's
module Main where
import Criterion.Main
import qualified Data.ByteString as S
import Data.ByteString (ByteString)
import Data.ByteString.Char8 (unpack)
--------------------------------------------------------------------------------
-- Apua's
-- > toChunks "qwer1234asdf" 5
-- ["qwer1","234as","df000"]
toChunks "" _ = []
toChunks str len = ch:toChunks str' len
where (ch, str') = get len str
get len str = if len==0 then ("", str) else (head:chunk, str')
where (head, tail) = pop str
(chunk, str') = get (len-1) tail
pop "" = (fill,"")
@apua
apua / 八極?
Created September 3, 2015 16:54
01英雄獨立→立 02關羽觀書→頂 03倚馬問路→問
04腦後摘盔→挑 05黑熊獻肘→頂 06靈獅洗臉→拂
07猛虎攔路→滾 08靈獅洗臉→拂 09猛虎攔路→滾
10獅子絞尾→探 11寒風入地→栽 12毒蠍出尾→蹬
13泰山壓頂→砸 14美女紉針→穿 15黃熊拔背→含