Skip to content

Instantly share code, notes, and snippets.

Avatar

Gampol T. me7

  • Thailand
View GitHub Profile
View machine.js
const garageDoorMachine = Machine(
{
id: "garageDoor",
initial: "idle",
context: {
pctOpen: 100,
interval: 250,
isOpen: true,
},
View mcs20.json
{"data":[{"id":1,"mc":"First Trust NASDAQ ABA Community Bank Index Fund","reason":"86753 Autumn Leaf Plaza","status":"fixing","timestamp":"1524162301","by":"Lori Shropshire"},
{"id":2,"mc":"EMCORE Corporation","reason":"47268 Dennis Way","status":"fixing","timestamp":"1516018640","by":"Evyn Hoofe"},
{"id":3,"mc":"Korn/Ferry International","reason":"07 Evergreen Circle","status":"wait approve","timestamp":"1522700359","by":"Philly Treadger"},
{"id":4,"mc":"Adecoagro S.A.","reason":"884 Derek Street","status":"wait approve","timestamp":"1510749370","by":"Samuel Venn"},
{"id":5,"mc":"Tsakos Energy Navigation Ltd","reason":"88 Burning Wood Parkway","status":"fixing","timestamp":"1522196996","by":"Franchot Lindemann"},
{"id":6,"mc":"Waste Management, Inc.","reason":"6 Shasta Place","status":"wait approve","timestamp":"1504969836","by":"Theresita Traice"},
{"id":7,"mc":"Permian Basin Royalty Trust","reason":"92 Pond Way","status":"fixing","timestamp":"1501157024","by":"Quintilla Ivimey"},
{"id":8,"mc":"KB Financial
@me7
me7 / cmd
Created Jul 21, 2017
use lua to execute ffmpeg
View cmd
function convert2wmv(filename)
return os.execute('ffmpeg -i \"'..filename..'\" -q:v -vf scale=w=854:h=854:force_original_aspect_ratio=decrease \"'..filename..'.wmv\"')
end
function convert2wma(filename)
return os.execute('ffmpeg -i \"'..filename..'\" -vn \"'..filename..'.wma\"')
end
function cutvideo(filename)
io.write("cut from (sec): ")
@me7
me7 / capture.py
Last active Oct 3, 2020
use adb to capture image and transfer to PC
View capture.py
# check device present: adb devices -> 5203d550fe3ea3ab
from time import clock, sleep
from subprocess import check_output, call
import re
#call this to capture image
def capture():
clock()
screen_on()
clear_camera_folder()
@me7
me7 / script.js
Last active Mar 31, 2017
lightning launcher select first item in folder
View script.js
var item = LL.getEvent().getItem();
if ( item.getType() != 'Folder' )
{
alert('Not a folder');
return;
}
var items = item.getContainer().getItems();
var count = items.getLength();
if ( count == 0 )
{
@me7
me7 / aes.md
Created Mar 30, 2017
python aes
View aes.md
@me7
me7 / download.js
Created Feb 8, 2017
Inject mithril to webpage
View download.js
//press F12 to open chrome dev tools
//then add mithril to header
var mt = document.createElement('script');
mt.src = "https://unpkg.com/mithril/mithril.js";
document.getElementsByTagName('head')[0].appendChild(mt);
//test render
m.render(document.body,"Hello");
//let create link and click
@me7
me7 / 0_reuse_code.js
Created Apr 20, 2016
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@me7
me7 / Clojure.sublime-settings
Created Mar 3, 2016 — forked from jamesmacaulay/Clojure.sublime-settings
Clojure stuff for Sublime Text 2. Files live in ~/Application Support/Sublime Text 2/Packages/User
View Clojure.sublime-settings
// installed Clojure packages:
//
// * BracketHighlighter
// * lispindent
// * SublimeREPL
// * sublime-paredit
{
"word_separators": "/\\()\"',;!@$%^&|+=[]{}`~?",
"paredit_enabled": true,