-
markdown preview enhanced is a Atom package
- preview markdown in Atom editor on the fly
- allow you to draw flow chart using power of
mermaid
- you can export the document in
html
orpdf
-
mermaid let you draw diagram like writing markdown
- supporting lots of diagram
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
// http://www.csie.ntnu.edu.tw/~u91029/DynamicProgramming.html#2 | |
function stairs(n) { | |
var res = []; | |
res[0] = 1; // first stair | |
res[1] = 1; // second stair | |
if (n > 0 && n < 2) return res[n-1]; | |
for (var i = 2; i < n; i++){ |
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
// http://stackoverflow.com/questions/19669786/check-if-element-is-visible-in-dom | |
//Where el is the DOM element you'd like to test for visibility | |
function isHidden(el) { | |
return (el.offsetParent === null); | |
} |
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
# coding=utf8 | |
import urllib | |
import re | |
from bs4 import BeautifulSoup as BS | |
url = 'http://www.dgpa.gov.tw/' | |
html_content = urllib.urlopen(url).read() | |
soup_obj = BS(html_content, 'html.parser') |
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 python3 | |
# Web Crawler for line stickers | |
# USAGE: | |
# $ python line_sticker_printer.py <url> | |
# example url: | |
# https://store.line.me/stickershop/home/user/zh-Hant | |
# https://store.line.me/stickershop/home/general/zh-Hant | |
# | |
# credit: | |
# jminh@github and hour of code |
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 | |
from threading import Thread | |
import time | |
class Man(object): | |
def __init__(self): | |
self.switch = True | |
def stop(self): | |
self.switch = False |
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
mc_menu = [ ["Big Mac" , "beef, cucumber, cheese" , 109 ], | |
["Filet-O-Fish" , "fish, cheese, mayonnaise" , 99 ], | |
["McChicken" , "chicken, lettuce, mayonnaise" , 89 ] ] | |
def print_burger( menu ): | |
i = 0 | |
while i < len( menu ) : | |
print ( menu[ i ][ 0 ] ) # print burger | |
print ( menu[ i ][ 2 ] ) # print price |
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
menu = [ 25, 105, 38, 55, 110 ] | |
drink = [ 35, 88, 140 ] | |
def change_price( price ): | |
result = [] | |
for e in price: | |
if e > 100: | |
e = e - 20 | |
result.append(e) | |
return result |
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
menu = [ 25, 105, 38, 55, 110 ] | |
drink = [ 35, 88, 140 ] | |
def change_price( price ): | |
i = 0 | |
while i < len(price): | |
if price[i] > 100: | |
price[i] = price[i] - 20 | |
i = i + 1 | |
return price |
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
record = '''12.0 TOR Defensive Rebound by Terrence Ross | |
12.0 93-102 LAL D'Angelo Russell missed 3-pt. Jump Shot | |
25.0 93-102 TOR Cory Joseph made 2nd of 2 Free Throws | |
25.0 93-101 TOR Cory Joseph missed 1st of 2 Free Throws | |
25.0 LAL Personal foul on Kobe Bryant | |
39.0 93-101 LAL Kobe Bryant made 2nd of 2 Free Throws | |
39.0 92-101 LAL Kobe Bryant made 1st of 2 Free Throws | |
39.0 TOR Shooting foul on Bismack Biyombo | |
43.0 LAL Full Timeout | |
43.0 91-101 TOR Cory Joseph made 2nd of 2 Free Throws |