Skip to content

Instantly share code, notes, and snippets.

View cwchiu's full-sized avatar

Chui-Wen Chiu cwchiu

View GitHub Profile
<template>
<h1>Hello, {{who}}</h1>
</template>
<script>
module.exports = {
props: {
who: {
type: String,
default: 'World'
@cwchiu
cwchiu / bigstash.py
Last active August 29, 2015 14:24
bigstash
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, division, with_statement, print_function
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import requests
import io
@cwchiu
cwchiu / GetYoutube.php
Created March 5, 2015 09:27
抓取 YouTube 影片下載網址
<?php
/***************************************************************************************************
* 功用:抓取 YouTube 影片下載網址
*
* 用法:在 console 模式下執行
* php-cgi -q getvideo.php "http://www.youtube.com/watch?v=ReUXNUy6w98&mode=related&search="
*
* 開發環境:
* [1] PHP5 for Windows
* [2] Windows XP Professional
# encoding: utf-8
def company_serial_no_checker(serial)
# 共八位,全部為數字型態
at_least_8_digits = /^\d{8}$/
return false unless at_least_8_digits.match(serial)
# 各數字分別乘以 1,2,1,2,1,2,4,1
# 例:統一編號為 53212539
// 錯誤的程式
while(true){
$v = 2;
switch($v){
case 1:
echo '1';
break;
default:
continue ;
}
@cwchiu
cwchiu / RecorderService.java
Last active February 4, 2021 07:09 — forked from qihnus/RecorderService.java
android note
import android.accessibilityservice.AccessibilityService;
import android.accessibilityservice.AccessibilityServiceInfo;
import android.util.Log;
import android.view.accessibility.AccessibilityEvent;
public class RecorderService extends AccessibilityService {
static final String TAG = "RecorderService";
private String getEventType(AccessibilityEvent event) {
@cwchiu
cwchiu / a.enex
Created August 8, 2014 03:45
Evernote .enex export to .html http://wp.me/p15ZOf-vS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE en-export SYSTEM "http://xml.evernote.com/pub/evernote-export2.dtd">
<en-export export-date="20140808T033704Z" application="Evernote/Windows" version="5.x">
<note><title>11111</title><content><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd">
<en-note style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
11111<en-media hash="ae0751e9bc3e3f41ec0a1dfe116a0bc1" style="cursor: default;" type="application/octet-stream"/><en-media hash="6bd172bc351ea767cbb49216da9c5fcf" style="cursor: default;" type="application/octet-stream"/></en-note>]]></content><created>20140808T030300Z</created><updated>20140808T033432Z</updated><resource><data encoding="base64">
UEsDBBQAAAAAAHGopj4AAAAAAAAAAAAAAAAEAAAAY3NzL1BLAwQUAAAACABHp6Y+Epomre0BAAAP
BwAADgAAAGNzcy9sYXlvdXQuY3NzzVVNb9swDL0HyH8wEOxSVKudJUOnnYYOxS677q5YtCNUFg2J
@cwchiu
cwchiu / 0_reuse_code.js
Created May 29, 2014 01:55
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console