Skip to content

Instantly share code, notes, and snippets.

View justin3737's full-sized avatar
🎯
Focusing

Justin justin3737

🎯
Focusing
View GitHub Profile
<html>
<head>
<title>拖曳物件</title>
</head>
<style>
.drop-area {
border: 1px solid black;
width: 300px;
height: 300px;
#!/usr/bin/env node
console.log('yay gist')
@justin3737
justin3737 / spell_check.py
Last active February 27, 2022 07:38
利用python 的 enchant 做拼字檢查
import enchant
from xml.dom.minidom import parse
import xml.dom.minidom
import js2py
import re
# ------------------- Define -------------------
pat = '[a-zA-Z]+'
xmlTags = ['String', 'value', 'string']
# ------------------- Use lib -------------------
@justin3737
justin3737 / crawler.py
Created March 21, 2018 06:22
利用Python的爬蟲與Chrome driver 爬中央氣象局網頁
from selenium import webdriver
chromedriver = "/Users/justin_w_wu/Documents/www/drivers/chromedriver"
web = webdriver.Chrome(chromedriver)
web.get('http://www.cwb.gov.tw/V7/')
web.find_element_by_link_text('生活氣象').click() #點擊頁面上"天氣預報"的連結
@justin3737
justin3737 / html_table_import_csv.py
Last active March 21, 2018 06:19
CMD帶入引數 利用BS4爬出表格內容 並輸出CSV
import codecs
import argparse
from bs4 import BeautifulSoup
#在CMD取得引數
parser = argparse.ArgumentParser()
parser.add_argument("-name") #<file_name.py> -name "html檔名"
args = parser.parse_args()
#讀取 HTML 靜態頁
@justin3737
justin3737 / diagonal-stripe-mixin.sass
Created December 17, 2016 01:54 — forked from nathos/diagonal-stripe-mixin.sass
Diagonal CSS stripe Sass/Compass mixin.
@mixin striped-bg($bg-color: #ccc, $darken-amount: 5%, $stripe-color: darken($bg-color, $darken-amount))
background-color: $bg-color
@include background-image(linear-gradient(-45deg, $stripe-color 25%, transparent 25%, transparent 50%, $stripe-color 50%, $stripe-color 75%, transparent 75%, transparent))
background-size: 40px 40px
.warning
font-family: sans-serif
font-weight: bold
color: #333
text-align: center
var monoose = require('mongoose');
mongoose.connect('mongodb://localhost/member3');
/* 新增Add */
var Product = mongoose.model('Product', {
title: String,
price: Number
});
@justin3737
justin3737 / app.js
Created August 20, 2016 11:13 — forked from Turbo87/app.js
webpack + font-awesome test
require('font-awesome/css/font-awesome.css');
document.body.innerHTML = '<i class="fa fa-fw fa-question"></i>';
function reducer(state = [], action) {
switch (action.type) {
case 'ADD_ATTENDEE':
// Return a new array with old state and added attendee.
return [{
name: action.name,
color: action.color
},
...state
];
Video Tutorial:
https://egghead.io/series/getting-started-with-redux
Lesson 05:
Redux: Writing a Counter Reducer with Tests
http://jsbin.com/piqapi/edit?js,console
Lesson 06:
Redux: Store Methods: getState(), dispatch(), and subscribe()
http://jsbin.com/jadunek/edit?js,console