Skip to content

Instantly share code, notes, and snippets.

View andy0130tw's full-sized avatar
🍌
why no 🍆

Andy Pan andy0130tw

🍌
why no 🍆
View GitHub Profile
'進行必要的屬性初始化
'對齊模式
ShockwaveFlash1.SAlign = "TL"
'禁用某些功能
ShockwaveFlash1.AllowFullScreen = True
ShockwaveFlash1.AllowNetworking = "all"
ShockwaveFlash1.AllowScriptAccess = "always"
'背景顏色,兩種語法等效
'ShockwaveFlash1.BackgroundColor = RGB(255, 255, 255)
ShockwaveFlash1.BGColor = "ffffff"
'Pixel & Twip 的換算
Public Function pixelToTwip(ByVal pixel As Long) As Long
pixelToTwip = Screen.TwipsPerPixelX * pixel
End Function
'LoadMovie
Public Function loadMovie(moviePath As String)
ShockwaveFlash1.Movie = moviePath
End Function
public var throttle:Function = function (fn:Function, delay:Number):Function {
var timer:* = null;
return function ():void {
var context:Object = this, args:Object = arguments;
clearTimeout(timer);
timer = setTimeout(function ():void {
fn.apply(context, args);
}, delay);
};
@andy0130tw
andy0130tw / CookieObject.js
Last active August 29, 2015 13:56
CookieObject
//CookieObject v1 by Andy Pan
// You can use the small piece of code to r/w
// > Cookies, not losing its structure of an object.
// > All complex contents will be automatically
// > en(de)code, but simple contents won't
// > so that you can access them without pain.
// Assume JSON.parse() and JSON.stringify().
// Use it with jquery.cookie by carhartl:
@andy0130tw
andy0130tw / createaccount.py
Created May 30, 2014 00:13
Learn Mode Account Generator
#-*- coding: utf-8 -*-
import pycurl
import json
import time
import datetime
import sys
import signal
import urllib
# IMPORTANT
@andy0130tw
andy0130tw / ui.html
Created June 1, 2014 16:20
HTML Drag'n'Drop Quick Example
<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<script>
function noop(e){
//e.stopPropagation();//取消drag預設動作
#define MAX 1000000
#define MULTI 1000
#include<cstdio>
#include<iostream>
#include<deque>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> point;
int n,f;
ll sum[MAX+1];
@andy0130tw
andy0130tw / _readme.md
Last active July 8, 2019 20:07
The Ice Tower Solver
@andy0130tw
andy0130tw / crsc2014.gbapi.php
Last active August 29, 2015 14:03
CRSC2014 Guestbook Backend
<?php
//Comment for easier reading
// Override default SQLite constructor to
// open the file at first.
class MyDB extends SQLite3{
function __construct(){
$this->open('dbstore/gb.sqlite');
}
}
@andy0130tw
andy0130tw / gbtest.html
Last active August 29, 2015 14:03
The frontend of CRSC2014 guestbook for Yu-Ren Pan! (For debugging only)
<!DOCTYPE html>
<html>
<head>
<title>Guestbook Test</title>
<script src="res/js/jquery-1.10.2.min.js"></script>
<script>
$(function(){
$("#gb_form").submit(function(){
$("#gb_submit").attr("disabled","disabled");
sendForm();