Skip to content

Instantly share code, notes, and snippets.

View johnteee's full-sized avatar

John Lee johnteee

  • Taipei
View GitHub Profile
@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/
@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 / 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 / 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 / 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 / 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 / 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 / bifunctor-profunctor.js
Created June 22, 2018 00:49 — forked from i-am-tom/bifunctor-profunctor.js
The main examples from the "Bifunctor + Profunctor" post.
const { Left, Right } = require('fantasy-eithers')
const daggy = require('daggy')
Function.prototype.map = function (f) {
return x => f(this(x))
}
//- Where everything changes...
const login = user =>
user.name == 'Tom'
@johnteee
johnteee / package.json
Created June 25, 2018 08:01 — forked from mburakerman/package.json
Webpack 4 config.js (SCSS to CSS and Babel) 👌 The Simplest Usage 👌
{
"name": "webpack-sass",
"version": "1.0.0",
"scripts": {
"start": "webpack-dev-server --open --mode development",
"build": "webpack -p"
},
"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.4",
@johnteee
johnteee / nodejs.errno.h
Created June 25, 2018 10:51 — forked from pbojinov/nodejs.errno.h
node.js errno descriptions. Useful for debugging.
/* Pulled from https://github.com/joyent/node/blob/master/deps/uv/include/uv.h */
/* Expand this list if necessary. */
#define UV_ERRNO_MAP(XX) \
XX(E2BIG, "argument list too long") \
XX(EACCES, "permission denied") \
XX(EADDRINUSE, "address already in use") \
XX(EADDRNOTAVAIL, "address not available") \
XX(EAFNOSUPPORT, "address family not supported") \
XX(EAGAIN, "resource temporarily unavailable") \
XX(EAI_ADDRFAMILY, "address family not supported") \