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
{ | |
"red": { | |
"50": "#ffebee", | |
"100": "#ffcdd2", | |
"200": "#ef9a9a", | |
"300": "#e57373", | |
"400": "#ef5350", | |
"500": "#f44336", | |
"600": "#e53935", | |
"700": "#d32f2f", |
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
// 文字列から ArrayBuffer への変換 | |
function string_to_buffer(src) { | |
return (new Uint16Array([].map.call(src, function(c) { | |
return c.charCodeAt(0) | |
}))).buffer; | |
} | |
// ArrayBuffer から文字列への変換 |
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
01 | 北海道 | / | / | |
---|---|---|---|---|
02 | 青森県 | /03/05/ | /岩手県/秋田県/ | |
03 | 岩手県 | /02/04/05/ | /青森県/宮城県/秋田県/ | |
04 | 宮城県 | /03/05/06/07/ | /岩手県/秋田県/山形県/福島県/ | |
05 | 秋田県 | /02/03/04/06/ | /青森県/岩手県/宮城県/山形県/ | |
06 | 山形県 | /04/05/07/15/ | /宮城県/秋田県/福島県/新潟県/ | |
07 | 福島県 | /04/06/08/09/10/15/ | /宮城県/山形県/茨城県/栃木県/群馬県/新潟県/ | |
08 | 茨城県 | /07/09/11/12/ | /福島県/栃木県/埼玉県/千葉県/ | |
09 | 栃木県 | /07/08/10/11/ | /福島県/茨城県/群馬県/埼玉県/ | |
10 | 群馬県 | /07/09/11/15/20/ | /福島県/栃木県/埼玉県/新潟県/長野県/ |
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
#!/usr/bin/env bash | |
convert -background none image.svg -define icon:auto-resize=64,48,32,16 favicon.ico |
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
#!/usr/bin/env bash | |
# @see http://superuser.com/questions/524793/convert-grayscale-image-into-alpha-channel-image-in-unix-shell | |
convert source.png -alpha copy -channel alpha -negate +channel -fx '#000' result.png |
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
node -e 'require("fs").writeFileSync(process.argv[1], "\uFEFF" + require("iconv-cp932").decode(require("fs").readFileSync(process.argv[1])))' filename.csv |
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
/** カタカナをひらがなに変換する関数 | |
* @param {String} src - カタカナ | |
* @returns {String} - ひらがな | |
*/ | |
function katakanaToHiragana(src) { | |
return src.replace(/[\u30a1-\u30f6]/g, function(match) { | |
var chr = match.charCodeAt(0) - 0x60; | |
return String.fromCharCode(chr); | |
}); |
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
const getTimezoneOffset = (timeZone, dt) => new Intl.DateTimeFormat("en-US", {timeZoneName: "longOffset", timeZone}).formatToParts(dt).find(v => v.type === "timeZoneName")?.value; | |
getTimezoneOffset("America/New_York", new Date()); // => "GMT-05:00" | |
getTimezoneOffset("America/New_York"); // => "GMT-05:00" | |
getTimezoneOffset("invalid"); // => Uncaught RangeError: Invalid time zone specified: |
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
const en_US = { | |
days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], | |
shortDays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], | |
months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], | |
shortMonths: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], | |
AM: "AM", | |
PM: "PM", | |
}; | |
const literal = { |
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
// Material Design Style Color Palette for LESS | |
// | |
// @see https://www.google.com/design/spec/style/color.html for source | |
// @see https://gist.github.com/kawanet/2d29cf6039734198169f3f3b70096748 for this | |
@red-50: #ffebee; | |
@red-100: #ffcdd2; | |
@red-200: #ef9a9a; | |
@red-300: #e57373; | |
@red-400: #ef5350; |
NewerOlder