Skip to content

Instantly share code, notes, and snippets.

View johnteee's full-sized avatar

John Lee johnteee

  • Taipei
View GitHub Profile
@johnteee
johnteee / gist:f9a5539dd56a22d84a555eb988870f2d
Created May 28, 2018 08:55 — forked from mahan/gist:6256149
Atomic boolean for golang
/* Atomic boolean for golang
A process-atomic boolean that can be used for signaling between goroutines.
Default value = false. (nil structure)
*/
package main
import "sync/atomic"
@johnteee
johnteee / python
Created April 19, 2018 14:23 — forked from fanglinlo/python
pinpon_game
import tkinter
import random
import time
tk=tkinter.Tk()
tk.title("Game") #窗口名稱
tk.resizable(0,0) #表示畫面大小不能被拉
tk.wm_attributes("-topmost",1) #視窗移到最上層
canvas=tkinter.Canvas(tk,width=700,height=700,bd=0)
@johnteee
johnteee / ustel.html
Created March 8, 2018 13:15 — forked from Miserlou/ustel.html
Validating a US (or international) phone number with Parsley and libphonenumber-js
<!-- requirements -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/parsley.js/2.6.2/parsley.min.js"></script>
<script src="https://halt-hammerzeit.github.io/libphonenumber-js/libphonenumber-js.min.js"></script>
<!-- custom validator -->
<script type="text/javascript">
$(document).ready(function() {
window.Parsley.addValidator('ustel', {
requirementType: 'string',
validateString: function(value) {
@johnteee
johnteee / SimpleStore.js
Last active March 6, 2018 06:04 — forked from ksafranski/SimpleStore.js
Simple localStorage function with Cookie fallback for older browsers.
/**
* Simple localStorage with Cookie Fallback
* v.1.0.0
*
* USAGE:
* ----------------------------------------
* Set New / Modify:
* store('my_key', 'some_value');
*
* Retrieve:
@johnteee
johnteee / FacebookDebugger.php
Created August 15, 2017 09:08 — forked from FrostyX/FacebookDebugger.php
Facebook API - Force facebook to reload cache from your website
<?php
class FacebookDebugger
{
/*
* https://developers.facebook.com/docs/opengraph/using-objects
*
* Updating Objects
*
* When an action is published, or a Like button pointing to the object clicked,
* Facebook will 'scrape' the HTML page of the object and read the meta tags.
@johnteee
johnteee / .tmux.conf
Created July 7, 2017 03:42 — forked from jakelazaroff/.tmux.conf
Some screen key bindings for tmux.
# set prefix to ctrl+a
unbind C-b
set -g prefix C-a
bind a send-prefix
# use space to cycle between windows
bind-key C-a last-window
bind-key Space next-window
bind-key C-Space previous-window
@johnteee
johnteee / obs-start.sh
Created May 12, 2017 04:52 — forked from nooitaf/obs-start.sh
obs cli options
obs --startrecording --startstreaming
# For OBS Studio,
# --collection [scene collection name],
# --profile [profile name],
# --scene [scene name],
# --startstreaming,
# --startrecording.
# https://obsproject.com/forum/threads/obs-studio-command-line-parameters.56185/