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
(namespace foo.core | |
(:require [clojure.spec.alpha :as s])) | |
(s/def ::n (s/or :integer integer? :string string?)) | |
(s/def ::m (s/keys :req-un [::n])) | |
(defn m-even? [m] (even? (:n m))) | |
(s/def ::m-even (s/and ::m m-even?)) |
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
// See https://www.quora.com/How-do-I-bulk-delete-likes-on-Twitter | |
inter = setInterval(() => { | |
$("html, body").animate({ | |
scrollTop: $(document).height()-$(window).height(), | |
complete: setTimeout(() => {$('.ProfileTweet-action--unfavorite').click().remove()}, 1000) | |
}) | |
if($('.has-more-items').length == 0) { | |
clearInterval(inter) |
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
{ | |
"swagger": "2.0", | |
"info": { | |
"description": "This is a partial Swagger representation of the EML Data Services API documentation version 1.0 that will be used to generate a .NET client. See https://developer.emerchants.com.au/paywith/eml.v1.html# for vendor documentation.", | |
"version": "1.0", | |
"title": "EML Data Services API", | |
"contact": { | |
"email": "tom.lynch@radicalsystems.com.au" | |
} | |
}, |
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
(ns goban | |
(:require [clojure.string :as string] | |
hiccup.core)) | |
(let [CEL 5.0 ; cell dimension in SVG viewport units | |
BDR 3.0 ; border width | |
PXR 10 ; ratio of pixels to SVG vw | |
BOA (* CEL 18) ; board side | |
DIM (+ BOA (* BDR 2))] ; goban side |
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
# Just chucking this here because the documentation's a little weak and someone | |
# might find it useful. This has changed a few times in QGIS history. | |
# NB this was hacked up from some code that worked in QGIS 3.4, 3.10 and 3.14, it | |
# may have minor indentation issues but … this is the gist of it. | |
from qgis.PyQt.QtCore import QObject, QUrl | |
from qgis.PyQt.QtNetwork import QNetworkReply, QNetworkRequest | |
from qgis.core import Qgis, QgsMessageLog, QgsBlockingNetworkRequest |
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 itertools, os, time | |
from sys import stdout | |
from osgeo import gdal, ogr, osr | |
# change these to the local paths if running this yourself | |
scratch = r"D:\scratch" | |
mbtilesFile = r"D:\big-mbtiles-file.mbtiles" | |
shapefile = r"C:\temp\regions.shp" | |
webMercator = osr.SpatialReference() |
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
#!/bin/sh | |
# Do all the directories first | |
find . -name 'SomePrefix*' -type d | awk '{print "mv "$0" "gensub(/\/SomePrefix(.*)$/,"/SomeOtherPrefix\\1","g");}' | sh | |
# Then do all the files | |
find . -name 'SomePrefix*' -type f | awk '{print "mv "$0" "gensub(/\/SomePrefix(.*)$/,"/SomeOtherPrefix\\1","g");}' | sh |
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
# -*- coding: utf-8 -*- | |
from collections import defaultdict | |
# A defaultdict variant of TupleDict with some improvements (eg better exceptions) | |
class DefaultTupleDict(defaultdict): | |
__slots__ = () | |
@classmethod | |
def fromkeys(cls, keys, v=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
; I fooled around a bit with this years ago, creating this Gist to replace the defunct repository on my personal GitHub. | |
; This is just standard Clojure Java interop, you can find out a bit more about JAudioTagger here if you're interested: | |
; | |
; https://search.maven.org/artifact/net.jthink/jaudiotagger | |
(ns wat.core | |
(:import (org.jaudiotagger.audio AudioFileIO AudioFile) | |
(org.jaudiotagger.tag FieldKey) | |
(java.io File))) |
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
Original source here: https://archive.ph/qUnBJ | |
Pedro Almodóvar | |
The Night of the Hunter (Laughton) | |
The Rules of the Game (Renoir) | |
All About Eve (Mankiewicz) | |
Leave Her to Heaven (Stahl) | |
North by Northwest (Hitchcock) | |
Out of the Past (Tourneur) |