This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// keymap setting and etc... | |
// store the state | |
static bool _is_key_locked = false; | |
void keyboard_post_init_user(void) { | |
// need to stop effects and animations | |
rgb_matrix_mode(RGB_MATRIX_NONE); | |
rgb_matrix_sethsv(HSV_OFF); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# provide some group's id | |
$gid=1000 | |
# POSIX way | |
cat /etc/group | grep ":x:$gid:" | cut -d: -f1 | |
# non-POSIX way which also handles LDAP | |
getent group "$gid" | cut -d: -f1 | |
# Note that we can't use `id` command for this purpose. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- - | |
~ 〜 | |
〜~ ~ | |
. 。 | |
, 、 | |
[ ち | |
] 」 | |
{ 「 | |
} 」 | |
・. … |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {readFile, writeFile, mkdir} from 'mz/fs' | |
import readline from 'mz/readline' | |
import promisify from 'es6-promisify' | |
import google from 'googleapis' | |
import googleAuth from 'google-auth-library' | |
import clientSecret from './client_secret.json' | |
// If modifying these scopes, delete your previously saved credentials | |
// at ~/.credentials/sheets.googleapis.com-nodejs-quickstart.json | |
const SCOPES = ['https://www.googleapis.com/auth/spreadsheets.readonly'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function normalizeDate (raw) { | |
const patterns = [ | |
// 2017-01-30 | |
{re: /^\d{4}-\d{2}-\d{2}($|,)/, f: m => m[0]}, | |
// 2017-01 | |
{re: /^\d{4}-\d{2}($|,)/, f: m => m[0]}, | |
// 2017 | |
{re: /^\d{4}($|,)/, f: m => m[0]}, | |
// 20170130 | |
{re: /^(\d{4})(\d{2})(\d{2})($|,)/, f: m => `${m[1]}-${m[2]}-${m[3]}`}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {join} from 'path' | |
import {createWriteStream} from 'fs' | |
import request from 'request' | |
import {parse, stringify} from 'JSONStream' | |
import find from 'lodash.get' | |
import highland from 'highland' | |
const apiRoot = 'https://api.openbd.jp/v1' | |
const cwd = process.cwd() | |
const distFile = join(cwd, 'all.json') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<app> | |
<h1>Riot</h1> | |
<p>A React-like user interface micro-library.</p> | |
<style scoped type="external"> | |
:scope { | |
display: block; | |
} | |
h1 { | |
border-bottom: 1px solid black; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ES6 | |
[...Array(10).keys()] | |
Array(10).map((n, i) => i) | |
Array.from(Array(10).keys()) | |
Array.from({ length:10 }, (v, i) => i) | |
// ES5 | |
Array(10).map(function(n, i) { return i }) | |
// Oldies |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Riot WIP, @license MIT, (c) 2015 Muut Inc. + contributors */ | |
;(function(window, undefined) { | |
'use strict' | |
var riot = { version: 'WIP', settings: {} } | |
// This globals 'const' helps code size reduction | |
// for typeof == '' comparisons | |
var T_STRING = 'string', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteRule (.*)_(.*) $1-$2 [N=10,DPI] | |
RewriteRule (.*) http://somewhere.dom/$1 [R=301] | |
</IfModule> |
NewerOlder