Skip to content

Instantly share code, notes, and snippets.

View sinpaout's full-sized avatar

Thet Win Aung / テウインアウン sinpaout

View GitHub Profile
@sinpaout
sinpaout / config
Created October 27, 2019 23:53
ssh config for github
ServerAliveInterval 30
ServerAliveCountMax 120
Host github github.com
HostName github.com
IdentityFile path/to/rsa/file
User git
Port 22
@sinpaout
sinpaout / uploadToDOSpaces.js
Created October 24, 2019 08:47
Sample for digital ocean spaces spaces uploading
const fs = require('fs')
const uuidv4 = require('uuid/v4')
const AWS = require('aws-sdk');
AWS.config.update({
accessKeyId: 'aaaabbbb',
secretAccessKey: 'aaabbbccc',
});
const spacesEndpoint = new AWS.Endpoint('nyc1.digitaloceanspaces.com');
@sinpaout
sinpaout / .eslint.json
Created October 24, 2019 02:25
Sample eslint included prettier for react project
{
"env": {
"browser": true,
"es6": true
},
"globals": {
"APP": true,
"jQuery": true,
"$": true,
@sinpaout
sinpaout / settings.json
Last active December 28, 2019 14:31
VScode's eslint setting for workspace
{
"eslint.alwaysShowStatus": true,
"eslint.enable": true,
"eslint.options": {
"configFile": ".eslintrc",
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
}
@sinpaout
sinpaout / keybindings.json
Last active May 26, 2019 09:42
Run eslint fro VSCode tasks.
....
{
"key": "ctrl+l",
"command": "workbench.action.tasks.runTask",
"args": "Fix lint current file"
},
...
@sinpaout
sinpaout / auto-rsync.js
Last active March 25, 2019 15:37
auto rsync with gulp task over ssh
// gulpfile.js
var gulp = require( 'gulp' );
var rsync = require( 'gulp-rsync' );
var rsyncHost = process.env.RSYNC_HOST || '0.0.0.0';
var rsyncPort = process.env.RSYNC_PORT || 22;
gulp.task( 'watch', function() {
var targets = [
'./js/**'
@sinpaout
sinpaout / dispatchKey.js
Created July 11, 2016 07:38
dispatch Enter key's keypress event.
// for detail http://stackoverflow.com/questions/8942678/keyboardevent-in-chrome-keycode-is-0/12522752#12522752
var ev = document.createEvent('Events');
ev.initEvent('keypress', true, true);
ev.keyCode = 13;
ev.which = 13;
ev.charCode = 13;
ev.key = 'Enter';
ev.code = 'Enter';
document.querySelector('.new-todo').dispatchEvent(ev);
@sinpaout
sinpaout / index.html
Last active May 2, 2016 08:47
test for graphed
<!DOCTYPE html>
<html lang="ja">
<head>
<script src="https://graphed.japacom.co.jp/graphed.js?pks=graph01:ZNAK8J3O0TLPSQFMVW11461826261465,graph02:PFK2TBCD9RV3IS5JQGA1453176946412"></script>
</head>
<body>
<div id="graph01" style="width: 500px;height: 500px;"></div>
<div id="graph02" style="width: 700px;height: 500px;"></div>
</body>
</html>