Skip to content

Instantly share code, notes, and snippets.

@mourner
mourner / TileLayer.Common.js
Created February 11, 2012 23:11
Leaflet shortcuts for common tile providers
// Lefalet shortcuts for common tile providers - is it worth adding such 1.5kb to Leaflet core?
L.TileLayer.Common = L.TileLayer.extend({
initialize: function (options) {
L.TileLayer.prototype.initialize.call(this, this.url, options);
}
});
(function () {
@hsiboy
hsiboy / BotBuster.md
Last active August 23, 2024 12:39
Bot-Buster™ - Tracks nefarious activity on website, and manages accordingly.

Bot-Buster™

Tracks nefarious activity on website, and manages accordingly.

It's probably a bot.

If the requesting entity:

  • declares its user-agent as being wget, curl, webcopier etc - it's probably a bot.
  • requests details -> details -> details -> details ad nauseum - it's probably a bot.
  • requests the html, but not .css, .js or site furniture - it's probably a bot.
@staltz
staltz / introrx.md
Last active February 28, 2025 10:00
The introduction to Reactive Programming you've been missing
@duhaime
duhaime / gist:9330473f9a4e288f00af
Created September 13, 2015 00:35
Cluster vectors with K-Means
from __future__ import division
from sklearn.cluster import KMeans
from numbers import Number
from pandas import DataFrame
import sys, codecs, numpy
class autovivify_list(dict):
'''Pickleable class to replicate the functionality of collections.defaultdict'''
def __missing__(self, key):
value = self[key] = []
@jtrecenti
jtrecenti / obras.R
Created March 8, 2017 15:55
baixar obras do governo
library(tabulizer)
library(tidyverse)
library(stringr)
library(abjutils)
u <- "http://legis.senado.leg.br/sdleg-getter/documento/download/a5e8c92c-86c1-45bb-99bd-3ad098905e81"
tab <- tabulizer::extract_tables(u)
arrumar <- function(x) {
x %>%
tolower() %>%
@aparrish
aparrish / understanding-word-vectors.ipynb
Last active February 20, 2025 02:47
Understanding word vectors: A tutorial for "Reading and Writing Electronic Text," a class I teach at ITP. (Python 2.7) Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@StevenACoffman
StevenACoffman / _MicroService Proxy Gateway Solutions.md
Last active July 15, 2024 05:12
Microservice Proxy/Gateway Solutions

MicroService Proxy Gateway Solutions

Kong, Traefik, Caddy, Linkerd, Fabio, Vulcand, and Netflix Zuul seem to be the most common in microservice proxy/gateway solutions. Kubernetes Ingress is often a simple Ngnix, which is difficult to separate the popularity from other things.

Github Star Trend:

Github Star History for Kong vs traefik vs fabio vs caddy vs Zuul

This is just a picture of this link from March 2, 2019

Originally, I had included some other solution

@Irio
Irio / amendments.csv
Last active December 28, 2017 01:12
Emendas de deputados federais ao orçamento da União (código-fonte em github.com/Irio/budget)
We can't make this file beautiful and searchable because it's too large.
achievement,achievement_code,additional_value,author,author_page_summary,category,department,destination,file_generation_date,file_generation_time,intervention,intervention_code,justification,location,number,proposed_wording,reference,total_page_summary,type,commitment_info_url,url
Implantação/Aparelham/Adequação Unid Saúde/ Aquis Unid Móvel,552,5.343.000,3230 - Jaime Martins,1 de 13,Individual,Saúde,ESPELHO DE EMENDA DE APROPRIAÇÃO DE DESPESA,2013-12-02,22:03,Atenção Especializada:Hospitais/Policlínicas/Unid.Especializ,003,,3100000 - Minas Gerais,32300001,,,3497 de 8807,Apropriação - Inclusão,http://inteligenciadenegocios3.camara.gov.br/painel/redirectorcamento.jsp?urlbo=iDocID=79334%26sOutputFormat=P%26sRefresh=Y%26lsSANO=2009%26lsSMES=12%26lsSORGAO=%26lsSUO=55901%26lsSACAO=2B31%26lsSSUBTITULO=0031,http://www.camara.gov.br/internet/comissao/index/mista/orca/orcamento/or2009/emendas/despesa/DANIELRJ_AV_LOA_AUTOR2_3230.pdf
Implantação/Aparelham/Adequação Unid Saúde/ Aquis Unid Móvel,552,2.000.000,3230 - Jaime
@Sporif
Sporif / nvidia-gpu-sensor.pl
Last active July 21, 2023 06:47 — forked from hacker1024/nvidia-gpu-sensor.pl
KDE KSysGuard NVIDIA GPU temperature/memory/utilization sensor, based on @frantic1048's script, but with units and total memory detection.
#!/usr/bin/perl -w
# act as a KSysGuard sensor
# provides NVIDIA GPU info via `nvidia-smi`
# Usage:
# 1. Save this script, make it executable and move it to a directory in your $PATH
# 2. Save this ksysguard sensor file for Nvidia: https://gist.github.com/Sporif/31f0d8d9efc3315752aa4031f7080d79
# 2. In KSysGuard's menu, open "File > Import Tab From File option"
# 3. Open the sensor file (nvidia.srgd)