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 DetailedIssueQuery from "./query.graphql"; |
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
<script> | |
import {writable} from "svelte/store"; | |
function createDialog() { | |
const internal = writable(undefined); | |
return { | |
...internal, | |
async show(param) { | |
let onResult = () => {}; | |
const promise = new Promise((resolve) => { |
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
export type Mapper<T> = { | |
toParam(value: T): string; | |
fromParam(value: string): T; | |
defaultValue: T; | |
}; | |
export type Mappers<Params> = { | |
[Name in keyof Params]: Mapper<Params[Name]>; | |
}; |
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 {readable, writable, Readable} from "svelte/store"; | |
export type AsyncReadable<T> = Readable<T> & { | |
promise: Readable<Promise<T>>; | |
}; | |
export function asyncReadable<T>(initialValue: T, resolver: () => Promise<T>): AsyncReadable<T> { | |
const promiseStore = writable(Promise.resolve(initialValue)); | |
return { | |
...readable(initialValue, (set: (value: T) => void) => { |
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 Cocoa | |
@dynamicCallable | |
struct Coroutine<Argument, Result> { | |
private enum Block { | |
case step((Argument) -> Result) | |
case delegation((Argument) -> Coroutine) | |
} | |
private let first: Block |
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
numbers = [] | |
crossing_points = 0 | |
open(ARGV[0]) {|input| | |
order = 0 | |
until input.eof? | |
n = input.readline.to_i | |
crossing_points << n | |
crossing_points += numbers.count {|m| m > n} | |
numbers << n | |
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
javascript:(function(){if(scrollY<=0)scrollTo(scrollX,0);var d=document,m=Math,b=d.body,ww=innerWidth,wh=innerHeight,bw=b.scrollWidth,bh=b.scrollHeight,c=d.createElement('div'),s=c.style,f=d.createElement('div'),fs=f.style;s.position=fs.position='absolute';s.padding=s.mergin=fs.padding=fs.mergin=s.top=s.left=0;s.width=bw+'px';s.height=bh+'px';s.zIndex=9999;s.backgroundColor='rgba(0,0,0,0.2)';fs.border='dashed 1px #f00';fs.backgroundColor='rgba(255,0,0,0.1)';fs.width=ww*ww/bw+'px';fs.height=wh*wh/bh+'px';var mf=function(nx,ny){fs.left=nx+ww*nx/bw+'px';fs.top=ny+wh*ny/bh+'px'};mf(scrollX,scrollY);fs.zIndex=9998;c.ontouchmove=c.ontouchstart=c.onmousemove=function(e){var t=e.touches?e.touches[0]:e,nx=m.max(m.min((t.pageX-scrollX)*bw/ww-ww/2,bw-ww),0),ny=m.max(m.min((t.pageY-scrollY)*bh/wh-wh/2,bh-wh),0);fs.visibility='hidden';mf(nx,ny);scrollTo(nx,ny);fs.visibility='visible';return false};c.ontouchend=c.ontouchcancel=c.onmousedown=function(){var x=scrollX,y=scrollY;b.removeChild(c);b.removeChild(f);scrollTo(x,y)} |
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
javascript:void((function(){t=$('head :last').text();ca=eval(t.substring(t.indexOf('setup(')+6,t.indexOf(']')+1));(function(ca){$('#answer').val($.map(ca,function(c,i){ca.splice(i,1,null);r=$.inArray(c,ca);ca.splice(i,1,c);return r}).join(','));$('#solve').submit()})(ca)})()) |
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
module MultiMethod | |
class GenericProc | |
class Node | |
attr_reader :type, :generic | |
def initialize(type) | |
@type = type | |
@generic = GenericProc.new | |
end | |
end | |
def self.truncate_args_for(proc, args) |