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
<html> | |
<head> | |
<title>Simple GraphiQL Example</title> | |
<link href="https://unpkg.com/graphiql/graphiql.min.css" rel="stylesheet" /> | |
</head> | |
<body style="margin: 0;"> | |
<div id="graphiql" style="height: 100vh;"></div> | |
<script type="module"> | |
await import('https://unpkg.com/react/umd/react.production.min.js') | |
await import('https://unpkg.com/react-dom/umd/react-dom.production.min.js') |
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
require 'date' | |
class Calendar | |
using Module.new { | |
refine(Date) do | |
def travel_back = Enumerator.produce(self, &:prev_day) | |
def travel_forward = Enumerator.produce(self, &:next_day) | |
def beginning_of_month = Date.new(year, month, 1) | |
def end_of_month = Date.new(year, month, -1) | |
end |
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
# https://gist.github.com/pablox-cl/6479725 | |
# ignore everything | |
* | |
!.gitignore | |
# except PKGBUILD needed files | |
!PKGBUILD | |
!*.install | |
!ChangeLog |
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
def f | |
sleep 1 | |
end | |
BEGIN { | |
using Module.new { | |
refine(Kernel) do | |
def sleep *; end | |
end | |
} |
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
type PathConverter<P> = (params: P) => string | |
type routes = { | |
boards: { | |
GET: { | |
pathParams: {} | |
bodyParams: {} | |
}, | |
POST: { | |
pathParams: {} | |
bodyParams: { title: string } |
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
require 'binding_of_caller' | |
using Module.new { | |
refine(Array) do | |
def map(&block) | |
caller = binding.of_caller(1) | |
cleanroom = Class.new(BasicObject) do | |
def respond_to?(*); true; end | |
def respond_to_missing?(*); true; end |
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
using Module.new { | |
refine(Array) do | |
def ractor_map(&block) | |
rs = map.with_index do |x, index| | |
r = Ractor.new(x, &block) | |
Ractor.new(r, index) do |r, index| | |
[r.take, index] | |
end | |
end | |
result = [] |
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
{ | |
"id": "989d0c27-7ee2-437e-8a62-0bfc6b0297f4", | |
"version": "2.0", | |
"name": "unlgtm", | |
"url": "https://qiita.com/", | |
"tests": [{ | |
"id": "254ccc0c-f1da-4788-824a-abf04e5a1ee6", | |
"name": "unlgtm", | |
"commands": [{ | |
"id": "d82b553e-69c0-422c-8517-ea4f931cde9b", |
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
// ==UserScript== | |
// @name Jump to GitHub from bugs.ruby-lang.org | |
// @namespace https://www.hanach.in/ | |
// @version 0.1.0 | |
// @description Add link to the commit on GitHub | |
// @author hanachin | |
// @match https://bugs.ruby-lang.org/projects/ruby-master/repository/git/revisions/* | |
// @grant none | |
// @run-at document-idle | |
// @license GPLv3 - http://www.gnu.org/licenses/gpl-3.0.txt |
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
tp = TracePoint.new(:call) do |tp| | |
next unless tp.method_id == :=== | |
$v = tp.self | |
end | |
tp.enable | |
class C | |
def deconstruct_keys(keys) | |
result = {} | |
result[:k] = $v |
NewerOlder