Skip to content

Instantly share code, notes, and snippets.

@josephj
josephj / fsck-git-log.sh
Created July 27, 2012 03:37
檔案在 git pull 後被刪除、可以用 git fsck 救回來
# 這個時候檔案都已經做完,想要放到 Github 上
josephj@cockatoo /var/www/josephj/frontend/lab/2012/qt-webkit $ % git init .
Initialized empty Git repository in /var/www/josephj/frontend/lab/2012/qt-webkit/.git/
# Github 的 Repo 也已經開好了 (已經產生好 README.md)
josephj@cockatoo /var/www/josephj/frontend/lab/2012/qt-webkit $ % git remote add origin [email protected]:miiicasa/tv-apps-html.git
# 先試著從 Github 上抓東西下來
josephj@cockatoo /var/www/josephj/frontend/lab/2012/qt-webkit $ % git pull
remote: Counting objects: 3, done.
<link rel="stylesheet" href="themes/base/jquery.ui.all.css">
<script src="jquery-1.7.2.js"></script>
<script src="ui/jquery.ui.core.js"></script>
<script src="ui/jquery.ui.widget.js"></script>
<script src="ui/jquery.ui.accordion.js"></script>
@josephj
josephj / xxx.html
Created February 1, 2012 09:41
HTML Test
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title> Prototype</title>
<link rel="stylesheet" href="http://yui.yahooapis.com/3.4.1/build/cssreset/reset-min.css">
<link rel="stylesheet" href="http://yui.yahooapis.com/3.4.1/build/cssfonts/fonts-min.css">
<script type="text/javascript" src="http://yui.yahooapis.com/3.4.1/build/yui/yui-min.js"></script>
<script src="https://raw.github.com/josephj/yui3-crossframe/master/crossframe.js"></script>
<style type="text/css">
/**
* The utility function to append JavaScript for script tag hack.
*
* @method _appendScript
* @param url {String} The JavaScript URL.
* @param loadHandler {Event} The onload event handler (optional).
* @return {HTMLElement} The script element.
*/
_appendScript = function (url, loadHandler) {
loadHandler = loadHandler || null;
YUI({
onCSS: function () {
alert("picker.css is loaded.");
},
modules: {
"picker-css": {
base: "http://josephj.com/lab/2011/yui3-load-css/",
path: "picker.css",
type: "css"
}
<?php
header("Access-Control-Allow-Origin: " . $_SERVER["HTTP_ORIGIN"]);
header("Access-Control-Allow-Methods: POST, GET");
header("Access-Control-Max-Age: 1");
header("Access-Control-Allow-Credentials: true");
$cookie = (isset($_COOKIE["cookie"]) && $_COOKIE["cookie"] !== "") ? $_COOKIE["cookie"] : NULL;
if ( ! $cookie)
{
@josephj
josephj / yui3-io-xdr-flash-cookie.html
Created December 26, 2011 15:40
Get cross-domain cookie by using YUI3 io (flash mode)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="created" content="2011-12-08">
<title>Y.io XDR using Flash</title>
<link rel="stylesheet" href="http://yui.yahooapis.com/3.4.1/build/cssreset/reset-min.css">
<link rel="stylesheet" href="http://yui.yahooapis.com/3.4.1/build/cssfonts/fonts-min.css">
<link rel="stylesheet" href="/prototype.css">
<script src="http://yui.yahooapis.com/3.2.0/build/yui/yui-min.js"></script>
@josephj
josephj / yui3-io-xdr-native-cookie.html
Created December 26, 2011 15:35
Get cross-domain cookie by using YUI3 io (native mode).
/**
* A convenience method to instantiate ID3.
*
* @method id3
* @static
* @param attrs {Object} The attribute object.
* @param callback {Function} The callback function.
* @param args {Array} The arguments you need in callback function.
*/