Demonstrates using d3.behavior.zoom
with a geographic projection. Based on an
example by Iain Dillingham.
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
// Credits to Louistiti from Drizzle Discord: https://discord.com/channels/1043890932593987624/1130802621750448160/1143083373535973406 | |
import { sql } from "drizzle-orm"; | |
const clearDb = async (): Promise<void> => { | |
const query = sql<string>`SELECT table_name | |
FROM information_schema.tables | |
WHERE table_schema = 'public' | |
AND table_type = 'BASE TABLE'; | |
`; |
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 { Constructor } from "@mikro-orm/core"; | |
import { EntityRepository, Knex } from "@mikro-orm/postgresql"; | |
type Node = string; | |
export interface ClosureTableRepository<Entity> extends EntityRepository<Entity> { | |
containsDescendant(parent: Node, descendant: Node): Promise<boolean>; | |
findDescendants(parent: Node): Knex.QueryBuilder; | |
insertLeafNode(leaf: Node, parent: Node): Promise<void>; | |
insertRootNode(root: Node): Promise<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 { useState, useEffect } from "react"; | |
import { useRouter } from "next/router"; | |
type IParam = string; | |
type IValue = string | string[] | number | number[] | null | undefined; | |
type IState = { [k: string]: IValue }; | |
type IQuery = IState; | |
type IRoute = string; | |
function isEmpty(value: IValue): boolean { |
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
var defaults = { | |
dotsize: 5, | |
gutsize: 1, | |
totsize: 6 | |
} | |
function heatmap(id, data, options) { | |
var self = {}; | |
var options = _.extend(defaults, options); | |
self.data = data || []; |
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
framework 'Cocoa' | |
class NSColor | |
def toCGColor | |
color_RGB = colorUsingColorSpaceName(NSCalibratedRGBColorSpace) | |
## approach #1 | |
# components = Array.new(4){Pointer.new(:double)} | |
# color_RGB.getRed(components[0], | |
# green: components[1], | |
# blue: components[2], |
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>Animated Sparkline using SVG Path and d3.js</title> | |
<script src="http://mbostock.github.com/d3/d3.v2.js"></script> | |
<style> | |
/* tell the SVG path to be a thin blue line without any area fill */ | |
path { | |
stroke: steelblue; | |
stroke-width: 1; | |
fill: none; |
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
Strophe.addConnectionPlugin("xdomainrequest", { | |
init: function () { | |
if (window.XDomainRequest) { | |
Strophe.debug("using XdomainRequest for IE"); | |
// override thee send method to fire readystate 2 | |
XDomainRequest.prototype.oldsend = XDomainRequest.prototype.send; | |
XDomainRequest.prototype.send = function() { | |
XDomainRequest.prototype.oldsend.apply(this, arguments); | |
this.readyState = 2; |
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
from __future__ import with_statement | |
import functools | |
import os | |
import sys | |
from fabric.api import * | |
from fabric.colors import green, red, green | |
import datetime | |
import re |
NewerOlder