Skip to content

Instantly share code, notes, and snippets.

@jackysee
jackysee / getTweetEmbedHtml.php
Created December 12, 2017 02:59
Get embed tweet html with pic in wordpress
<?php
/*
The code below would help you to grap the twitter link in a string and return
the embeded HTML code, and replace twitter pic any.
I used it for reposting in my site (check https://indieweb.org/repost )
require: twitteroauth ( https://github.com/abraham/twitteroauth )
*/
require "twitteroauth/autoload.php";
function getStatus( $id ){
@jackysee
jackysee / twitter-bookmarklet
Created October 19, 2017 02:14
twitter bookmarklet minimal
javascript:void(function(){var%20F=document,E=encodeURIComponent;window.open(`https://twitter.com/intent/tweet?text=${E(F.title)}&url=${E(F.location.href)}`);}());

Keybase proof

I hereby claim:

  • I am jackysee on github.
  • I am jackysee (https://keybase.io/jackysee) on keybase.
  • I have a public key ASDlDr7dQIVahLrb6HgDTNBnPgXrHw04Ihw3AXJ9C2ZNSgo

To claim this, I am signing this object:

@jackysee
jackysee / PrettierVueFile.js
Created August 10, 2017 02:14
Run prettier on vue file
const prettier = require('prettier');
const options = require('./package.json').prettier || {};
const fs = require('fs');
const parser = require('html-script-hook');
const file = process.argv[2];
const source = fs.readFileSync(file, 'utf8');
const result = parser(source, {
scriptCallback: function(code) {
@jackysee
jackysee / index.html
Last active December 23, 2016 09:53
Donut chart in Vanilla es6
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<div id="svg"></div>
@jackysee
jackysee / decodeRssEnclosure.elm
Created October 26, 2016 03:05
Decoding ill-formated JSON in Elm, using RSS enclosure as an example
-- copy me to http://elm-lang.org/try
import Html exposing (text)
import Json.Decode as Json exposing ((:=))
import String
import Regex
type alias Model =
{ list : List Item }
@jackysee
jackysee / decode.elm
Created October 13, 2016 14:54
Decode different format of json in elm
import Html exposing (text)
import Json.Decode as Decode exposing ( Decoder, (:=), at )
jsonString1 =
"{ \"enclosure\" : { \"url\": \"aaa\" } }"
jsonString2 =
"{ \"enclosure\" : [ {\"url\": \"ccc\"}, {\"url\" : \"bbb\"} ] }"
type alias Enclosure =

陶傑壹杯茶

懷念粗口學術大師 黃霑

霑伯因肺癌復發仙遊,全港評論一面倒讚揚霑伯的粵語流行曲的「文化」貢獻,絕少人敢推崇霑伯的粗口鹹濕「不文化」成就。

只談「文化霑」,少提「不文霑」,正如只講經濟建設,不講民主自由,對霑伯不公道,對社會後世也不負責。霑伯的功業,是「粵語流行曲其體,鹹濕不文精神其魂」,香港人不要只知道〈兩忘煙水裡〉的才子黃霑,更要高度評價「兩忘粗口中」的不文老霑。

霑伯首創「粗口學」,把廣東粗口「學術化」,更循循善誘。例如霑伯不止一次向我提點:時下的旺角金毛強和大學生,說起粵語粗口的lun字,都誤作為「撚」,霑伯一見到粗口的正字遭受褻瀆,必定仗義執言:「撚條×呀?呢個『撚』字,唔係粗口!係『撚手小菜』個『撚』呀,個字音,係N,唔×係L呀!」

@jackysee
jackysee / ng2-scratch.md
Last active March 13, 2017 22:39
Create minimal Angular2 App from scratch

Here is how you can create a bare Angular2 app

mkdir HelloApp
cd HelloApp
npm init -y
npm install angular2 systemjs --save --save-exact
npm install live-server typescript npm-run-all --save-dev
mkdir app

edit app\app.ts

@jackysee
jackysee / umb_banner.html
Created October 24, 2014 09:05
umbrella banner
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Umbrella</title>
<link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<style>
#banner{
width: 200px;
padding: 20px;