Skip to content

Instantly share code, notes, and snippets.

View andy23512's full-sized avatar

Tangent Chang andy23512

  • Tainan, Taiwan
  • 14:20 (UTC +08:00)
View GitHub Profile
@andy23512
andy23512 / modal-ajax-form.ls
Last active October 8, 2017 07:47
modal-ajax-form: frequently used combination
window.$.fn.modal-ajax-form = (opt) ->
$modal = $ @
$form = $modal.find \form
ajax-form-opt = do
before-submit: ->
$modal.find \button .add-class \loading
$form.find \.field.error .remove-class \error .find \span .empty!
success: ->
$modal.find \button .remove-class \loading
@andy23512
andy23512 / tkinter_menu.py
Created October 26, 2017 10:42
Get menu label when click on a command in Tkinter Menu
from tkinter import *
from tkinter import ttk
def test(sheet_name, material):
print(sheet_name)
print(material)
class material_menu():
import pandas
from datetime import timedelta, date
def getstockdate(dayary):
[y, m, d] = dayary
url = ('https://www.taifex.com.tw/chinese/3/3_1_1.asp?qtype=2&commodity_id=TX&commodity_id2&market_code=0&goday&dateaddcnt=0'
+ '&DATA_DATE_Y=%d' % y
+ '&DATA_DATE_M=%d' % m
+ '&DATA_DATE_D=%d' % d
@andy23512
andy23512 / plot.py
Last active January 31, 2018 11:28
matplotlib: plot multiple 2d line in 3d
"""
=======================
Plot 2D data on 3D plot
=======================
Demonstrates using ax.plot's zdir keyword to plot 2D data on
selective axes of a 3D plot.
"""
from mpl_toolkits.mplot3d import Axes3D
@andy23512
andy23512 / test.cpp
Last active February 28, 2018 00:11
#include <iostream>
using namespace std;
void print_int_array(int a[], int length) { // helper function to print array
for(int i = 0; i < length; i++) {
cout << a[i] << " ";
}
cout << endl;
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@andy23512
andy23512 / main.ipynb
Last active March 9, 2018 10:50
Use regex to search text in html via BeautifulSoup
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@andy23512
andy23512 / main.ipynb
Last active March 9, 2018 23:56
get code in react codemirror via selenium
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@andy23512
andy23512 / plot.ipynb
Last active March 11, 2018 04:13
Remove matplotlib margin with plt.axis or mpl.rcParams config (reference: https://stackoverflow.com/a/45667625 )
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@andy23512
andy23512 / main.ipynb
Last active March 13, 2018 17:23
crawler example
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.