Skip to content

Instantly share code, notes, and snippets.

View me7's full-sized avatar

Gampol T. me7

  • Thailand
View GitHub Profile
@me7
me7 / machine.js
Created June 19, 2020 06:40
Generated by XState Viz: https://xstate.js.org/viz
const garageDoorMachine = Machine(
{
id: "garageDoor",
initial: "idle",
context: {
pctOpen: 100,
interval: 250,
isOpen: true,
},
{"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 July 21, 2017 10:01
use lua to execute ffmpeg
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 June 24, 2024 22:35
use adb to capture image and transfer to PC
# 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 March 31, 2017 09:09
lightning launcher select first item in folder
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 March 30, 2017 09:59
python aes
@me7
me7 / download.js
Created February 8, 2017 02:23
Inject mithril to webpage
//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 April 20, 2016 09:43
Here are some things you can do with Gists in GistBox.
// 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 March 3, 2016 10:06 — forked from jamesmacaulay/Clojure.sublime-settings
Clojure stuff for Sublime Text 2. Files live in ~/Application Support/Sublime Text 2/Packages/User
// installed Clojure packages:
//
// * BracketHighlighter
// * lispindent
// * SublimeREPL
// * sublime-paredit
{
"word_separators": "/\\()\"',;!@$%^&|+=[]{}`~?",
"paredit_enabled": true,