Skip to content

Instantly share code, notes, and snippets.

@thisismattmiller
thisismattmiller / yahoo_sitemap.py
Created April 11, 2021 14:43
Download yahoo answers sitemap
import requests
import xml.etree.ElementTree as ET
import json
import multiprocessing
answer_urls = []
def do_work(url):
print(url)
urls = []
# -*- coding: utf-8 -*-
"""
/***************************************************************************
WMS Catasto Agenzia delle Entrate CC BY 4.0
-------------------
copyright : (C) 2020 by Giulio Fattori
email : xxxxx.xxxxxxx@xxxxx.it
***************************************************************************/
"""
@janwillemtulp
janwillemtulp / simple-password-protection.svelte
Created May 20, 2020 12:45
Svelte simple static page password protection
<script>
let password = ''
const hash = s =>
s.split('').reduce((a, b) => {
a = (a << 5) - a + b.charCodeAt(0)
return a & a
}, 0)
$: console.log(password, hash(password))
@jeff3dx
jeff3dx / d3-in-react.js
Last active October 27, 2022 09:24
D3 in React with Hooks
import React, { useRef, useEffect } from 'react';
import * as d3 from 'd3';
interface IProps {
data?: number[];
}
/* Component */
export const MyD3Component = (props: IProps) => {
/* The useRef Hook creates a variable that "holds on" to a value across rendering
@pbeshai
pbeshai / .block
Last active March 21, 2025 08:55
Animate thousands of points with canvas and D3
license: mit
height: 620
border: no
@tzmartin
tzmartin / m3u8-to-mp4.md
Last active December 24, 2025 06:37
m3u8 stream to mp4 using ffmpeg

1. Copy m3u8 link

Alt text

2. Run command

echo "Enter m3u8 link:";read link;echo "Enter output filename:";read filename;ffmpeg -i "$link" -bsf:a aac_adtstoasc -vcodec copy -c copy -crf 50 $filename.mp4
@1wheel
1wheel / README.MD
Created January 15, 2017 15:34
you-draw-it
@tmcw
tmcw / ticks.js
Created September 26, 2016 18:59
import * as d3 from 'd3';
import React from 'react';
const top = 1;
const right = 2;
const bottom = 3;
const left = 4;
const epsilon = 1e-6;
function translateX(scale0, scale1, d) {
@veltman
veltman / README.md
Last active April 26, 2019 04:24
Strip map with labels

A version of this strip map with some labeled features.

Labels are a bit trickier than background features because you don't want to clip them to the zones, but you can't just create one copy per zone of each, or you'll get a bunch of identical labels approximately on top of each other and it will look weird. This uses a point-in-polygon test to assign each labeled point to its proper zone at the start. Once that assignment is done, you could put the labels in their own top layer if you had to worry about other features overlapping (not really an issue in this case).

@longhotsummer
longhotsummer / leaflet-big-image-full.html
Created April 5, 2016 06:47
Full example of using leaflet to pan and zoom a big image, as described at http://kempe.net/blog/2014/06/14/leaflet-pan-zoom-image.html
<html>
<!-- See also: http://kempe.net/blog/2014/06/14/leaflet-pan-zoom-image.html -->
<head>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css"></script>
<style>
#image-map {
width: 100%;
height: 300px;
border: 1px solid #ccc;
margin-bottom: 10px;