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
defmodule Dynamic do | |
defdelegate start_link(), to: Dynamic.Server | |
defdelegate new, to: Dynamic.Supervisor | |
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
def color_graph(ordering, adj_list): | |
coloring = [-1 for _ in ordering] | |
for node in ordering: | |
color = 0 | |
used_colors = set([coloring[neighbor] for neighbor in adj_list[node]]) | |
while color in used_colors: | |
color = color + 1 | |
coloring[node] = color | |
return coloring |
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
defmodule Player.Client do | |
def effect(pid, effect) do | |
GenServer.cast(pid, {:effect, effect}) | |
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
defmodule Stopwatch.Client do | |
def subscribe(pid, func) do | |
GenServer.cast(pid, {:subscribe, func}) | |
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
import {subscribe} from "tiny-pubsub" | |
import {update_bullet} from './update_bullet' | |
let bullets = {}; | |
subscribe("bullet", bullet => { | |
bullets[bullet.id] = bullet; | |
}) | |
subscribe("tick", (current_time, world) => { |
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
# Copies the most recent history matching a given query to the X11 clipboard provided | |
# Example | |
# > hcopy run | |
# > # ctrl-V | |
# > ./run.sh --some-arg | |
# Requires X11 Forwarding in SSH | |
# https://www.unixtutorial.org/get-x11-forwarding-in-macos-high-sierra |
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 ids = new Set(); | |
export function isIdFree(id: string): boolean { | |
return ids.has(id); | |
} | |
export function takeId(id: string) { | |
ids.add(id); | |
} |
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 * as PIXI from "pixi.js"; | |
import {Emitter, EmitterConfig} from 'pixi-particles'; | |
import { | |
CustomPIXIComponent, | |
} from "react-pixi-fiber"; | |
interface ParticleEmitterProps { | |
x: number; | |
y: number; |
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
python setup.py sdist bdist_wheel | |
twine upload dist/* |
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
{0: 'tench, Tinca tinca', | |
1: 'goldfish, Carassius auratus', | |
2: 'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias', | |
3: 'tiger shark, Galeocerdo cuvieri', | |
4: 'hammerhead, hammerhead shark', | |
5: 'electric ray, crampfish, numbfish, torpedo', | |
6: 'stingray', | |
7: 'cock', | |
8: 'hen', | |
9: 'ostrich, Struthio camelus', |
OlderNewer