This file contains 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
String.prototype.cnvPhone = function(defaultPrefix){ | |
var str0 = this, str1, str; | |
str1 = str0.replace(/[^\d]/g, ''); | |
if (defaultPrefix && /^[^0]/.test(str1)) str1 = defaultPrefix+str1;//0以外で始まる場合、デフォルトの局番を追加 | |
str = str1; | |
str = str.replace(/^0(9969|9913|9912|9802|9496|8636|8514|8512|8477|8396|8388|8387|7468|5979|5769|4998|4996|4994|4992|1658|1656|1655|1654|1648|1635|1634|1632|1587|1586|1564|1558|1547|1466|1457|1456|1398|1397|1392|1377|1374|1372|1267)(\d)(\d{4})$/, "0$1-$2-$3");//固定電話市外4桁 | |
str = str.replace(/^0(997|996|995|994|993|987|986|985|984|983|982|980|979|978|977|974|973|972|969|968|967|966|965|964|959|957|956|955|954|952|950|949|948|947|946|944|943|942|940|930|920|898|897|896|895|894|893|892|889|887|885|884|883|880|879|877|875|869|868|867|866|865|863|859|858|857|856|855|854|853|852|848|847|846|845|838|837|836|835|834|833|829|827|826|824|823|820|799|798|797|796|795|794|791|790|779|778|776|774|773|772|771|770|768|767|766|765|763|761|749|748|747|746|745|744|743|742|740|739|738|737|736|735|725|721|599|59 |
This file contains 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 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 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(){ | |
var fbpage_id = 131130253626713;// change to your facebook page id. | |
var fbpage_feed = 'https://www.facebook.com/feeds/page.php?format=atom10&id=' + fbpage_id; | |
var feed_api = 'https://ajax.googleapis.com/ajax/services/feed/load?v=1.0&q=' + encodeURIComponent(fbpage_feed); | |
$.getJSON(feed_api + '&callback=?', function(data){ | |
$(data.responseData.feed.entries).each(function(index){ | |
$('ul#update-feed').append($('<li />', { | |
'data-role': "list-divider" | |
}).append($('<a />', { | |
'href': this.link, |
This file contains 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 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 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1"> | |
<style> | |
body { | |
margin: 40px 0 0 0; | |
padding: 0; |
This file contains 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
# Cross-Browser Split 1.0.1 for CoffeeScript | |
# (c) Tsutomu Kawamura @OSSCafe; just converting to CoffeeScript | |
# (c) Steven Levithan <stevenlevithan.com>; MIT License | |
# An ECMA-compliant, uniform cross-browser split method */ | |
if !cbSplit | |
cbSplit = (str, separator, limit) -> | |
# if `separator` is not a regex, use the native `split` | |
return cbSplit._nativeSplit.call str, separator, limit if Object::toString.call(separator) isnt "[object RegExp]" | |
This file contains 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 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
<?php | |
// https://github.com/facebook/php-sdk/ | |
require_once 'path/to/facebook.php'; | |
// http://www.kigkonsult.se/iCalcreator/ | |
require_once 'path/to/iCalcreator.class.php'; | |
$config = array( | |
'appId' => 'xxxx',//change to your fb app id | |
'secret' => 'yyyy',//change to your fb app secret | |
'pageId' => 'shimokitazawa.osscafe',//change to target fb page id |
NewerOlder