Skip to content

Instantly share code, notes, and snippets.

View lukyth's full-sized avatar
🐈
Meow

Kanitkorn Sujautra lukyth

🐈
Meow
View GitHub Profile
import { compose, mapProps } from 'recompose'
import { withSelectors } from '../tw-app-core'
import Features from './Features'
import { selectFeatures } from './selectors'
export default (
mapToProps: (features: Features) => { [key: string]: boolean }
) =>
compose(
@lukyth
lukyth / gpg.sh
Created November 3, 2016 08:31
gpg setup
brew install gnupg gnupg2 pinentry-mac
gpg2 --gen-key
# 1 > 4096 > 0
# Name > Email > Comment (Machine Name?)
gpg2 --list-secret-keys --keyid-format LONG
# sec 12345/1234567890987654 2016-11-03 >> 1234567890987654 is <id>
git config --global user.signingkey <id>
gpg2 --armor --export <id>
# copy the output to Create new GPG Key in https://github.com/settings/keys
@lukyth
lukyth / parse_mail.js
Last active March 9, 2016 07:38 — forked from veer66/parse_mail.js
โปรแกรมสำหรับ แกะ e-mail จาก folder ครับ
// npm install mailparser
// node parse_mail.js
var MailParser = require('mailparser').MailParser
var fs = require('fs')
var dirname = 'sample/'
var resultDir = 'result/'
if (!fs.existsSync(resultDir)){
fs.mkdirSync(resultDir)
}
alias zshconfig="s ~/.zshrc"
alias ohmyzsh="s ~/.oh-my-zsh"
alias c=cd
alias nv="latest-version"
alias nh="npm docs"
alias nis="npm install --save"
alias nid="npm install --save-dev"
alias ags="ag --ignore-case --literal"
alias nl="npm link --force"
alias g=git
var feed = document.querySelectorAll('.alert')
var feedType = {}
feed.forEach(function(el){
(el.classList).forEach(function(className){
if (feedType[className]) {
feedType[className] += 1
} else {
feedType[className] = 1
}
})
var inputs = document.querySelectorAll('input[value="5"]')
inputs.forEach(function(el){
el.checked = true
})
var submit = document.querySelector('input[name="OK"]')
submit.click()
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<script src=jquery-2.1.4.min.js></script>
<script>
var old_id="";
@lukyth
lukyth / styles.less
Created July 12, 2015 18:55
product-box mixin
.product-box {
float: left;
margin: 20px;
width: 400px;
background-color: #ddd;
box-shadow: 0 3px #cbcbcb;
border-radius: 3px;
padding: 10px;
display: flex;
.product-box-picture {
@lukyth
lukyth / script
Last active August 29, 2015 14:23
steam playtime finder
var time = 0,
games = document.querySelectorAll(".gameListRow h5"),
text;
for (var i = 0, len = games.length; i < len; i++) {
text = games[i].innerHTML;
if(text != "") {
time += parseFloat(text.replace(",", "").split(" ")[0]);
}
}
console.log(time);
['id' => 3,
'name' => 'Derma Cup Organic Coffee',
'slug' => 'derma-cup-organic-coffee',
'tel' => '027519968',
'open_time' => '10:00:00',
'close_time' => '21:00:00',
'open_day' => 'ทุกวัน',
'min_price' => '0',
'max_price' => '100',
'building' => 'Sena Fest',