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
(() => { | |
const promise = fetch("//api.github.com/users/octocat/orgs"); | |
promise.then(res => { | |
const headers = res.headers; | |
for (let key of headers.keys()) { | |
console.log(`${key} : ${headers.get(key)}`); | |
} | |
return res.json(); // return JSON object, not serialized 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
// ==UserScript== | |
// @name リンク化 | |
// @namespace jp.hateblo.htsign | |
// @version 1.2.3 | |
// @grant none | |
// @downloadURL https://gist.github.com/htsign/5eed5473a9e75c7c45f3a5571d7d0803/raw/convertTextToLink.user.js | |
// ==/UserScript== | |
(() => { | |
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
// ==UserScript== | |
// @name confortable-xpath | |
// @namespace https://htsign.hateblo.jp | |
// @description XPathをより使いやすい形で提供します。 | |
// @match * | |
// @version 1.0.8 | |
// @grant none | |
// @run-at document-start | |
// @updateURL https://gist.github.com/htsign/a36e74eee2151dc2c047e03245638f68/raw/confortable-xpath.user.js | |
// @downloadURL https://gist.github.com/htsign/a36e74eee2151dc2c047e03245638f68/raw/confortable-xpath.user.js |
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
using Nemerle; | |
using System.Console; | |
using System.Numerics; | |
module Program | |
{ | |
Main() : void | |
{ | |
def fib(n) | |
{ |
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
// ==UserScript== | |
// @name blink-star | |
// @namespace jp.hateblo.htsign | |
// @description はてなブックマークにて、自分が付けたスターを点滅させて見分けがつくようにします。 | |
// @match http://b.hatena.ne.jp/* | |
// @match https://b.hatena.ne.jp/* | |
// @version 1.0.8 | |
// @updateURL https://gist.github.com/htsign/eb1b8917a4b6f9a29302b38d258e4770/raw/blink-star.user.js | |
// @downloadURL https://gist.github.com/htsign/eb1b8917a4b6f9a29302b38d258e4770/raw/blink-star.user.js | |
// @grant none |
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
module RegExp | |
open System.Text.RegularExpressions | |
type NamedValue = Map<string, string> | |
let private noneOrList = function [] -> None | xs -> Some xs | |
let private getValues (m : Match) = List.tail [for g in m.Groups -> g.Value] | |
let private getNamedValues (ns : string []) (gs : GroupCollection) = List.tail [for n in ns -> n, gs.[n].Value] |> Map.ofList | |
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
if (typeof NodeIterator.prototype[Symbol.iterator] !== 'function') { | |
Object.defineProperty(NodeIterator.prototype, Symbol.iterator, { | |
configurable: true, | |
writable: true, | |
*value() { | |
let node; | |
while ((node = this.nextNode()) !== null) { | |
yield node; | |
} | |
} |
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
class ChartHelper { | |
public static checkScaleType<T, R>(scale: Scale<T, R>): ScaleType { | |
const f = scale.copy.toString(); | |
switch (true) { | |
case f.includes("d3_scale_linear") : return "linear"; | |
case f.includes("d3_scale_identity"): return "identity"; | |
case f.includes("d3_scale_pow") : return "power"; | |
case f.includes("d3_scale_log") : return "log"; | |
case f.includes("d3_scale_quantize"): return "quantize"; | |
case f.includes("d3_scale_quantile"): return "quantile"; |
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
#Thu Oct 19 09:54:42 JST 2017 | |
\!/= | |
/instance/org.eclipse.ui.workbench/org.eclipse.ui.commands=<?xml version\="1.0" encoding\="UTF-8"?>\r\n<org.eclipse.ui.commands>\r\n<activeKeyConfiguration keyConfigurationId\="org.eclipse.cdt.ui.visualstudio"/>\r\n<keyBinding commandId\="org.eclipse.wst.jsdt.ui.edit.text.java.open.editor" contextId\="org.eclipse.wst.jsdt.ui.javascriptViewScope" keyConfigurationId\="org.eclipse.ui.defaultAcceleratorConfiguration" keySequence\="F12"/>\r\n<keyBinding contextId\="org.eclipse.jst.jsp.ui.structured.text.editor.jsp.scope" keyConfigurationId\="org.eclipse.ui.defaultAcceleratorConfiguration" keySequence\="ALT+SHIFT+R"/>\r\n<keyBinding contextId\="org.eclipse.ui.textEditorScope" keyConfigurationId\="org.eclipse.ui.defaultAcceleratorConfiguration" keySequence\="CTRL+K"/>\r\n<keyBinding contextId\="org.eclipse.ui.contexts.window" keyConfigurationId\="org.eclipse.ui.defaultAcceleratorConfiguration" keySequence\="CTRL+."/>\r\n<keyBinding contextId\="org.eclipse.debug.ui.debugging" keyCon |
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 java.math.BigDecimal; | |
import java.util.List; | |
import java.util.function.BiFunction; | |
import java.util.regex.Matcher; | |
import java.util.regex.MatchResult; | |
import java.util.regex.Pattern; | |
import java.util.stream.Collectors; | |
public class MyStringUtils { | |
public static String replaceEx( |