Skip to content

Instantly share code, notes, and snippets.

@Daan-Grashoff
Daan-Grashoff / README.md
Last active March 27, 2025 14:19
Bring back the google maps button when searching on google

Google Maps Button Restorer

This userscript brings back the Maps button in Google Search results, making it easy to search locations directly in Google Maps.

Features

  • Adds a Maps button next to the "All", "Images", "News" tabs in Google Search
  • Works across multiple Google domains (.com, .co.uk, .nl, .de, .fr)
  • Automatically updates when using Google's dynamic search
  • Maintains button presence during navigation
@a7madgamal
a7madgamal / dark.md
Last active November 24, 2024 16:39
Dark mode for Slack on MacOS
@dingran
dingran / dijkstra.py
Last active November 30, 2023 22:43
Python implementation of Dijkstra's algorithm, single source all desinations and single source single destination
from collections import defaultdict
def build_graph(edge_list):
graph = defaultdict(list)
seen_edges = defaultdict(int)
for src, dst, weight in edge_list:
seen_edges[(src, dst, weight)] += 1
if seen_edges[(src, dst, weight)] > 1: # checking for duplicated edge entries
continue
@JonnyWong16
JonnyWong16 / collection_from_rating_keys.py
Last active November 9, 2024 07:56
Create a Plex collection from a text file list of rating keys.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Description: Create a Plex collection from a text file list of rating keys.
# Author: /u/SwiftPanda16
# Requires: plexapi
from plexapi.server import PlexServer
@hanfang
hanfang / shortestPath.py
Last active December 4, 2024 10:11
Finding the shortest path in a weighted DAG with Dijkstra in Python and heapq
import collections
import heapq
def shortestPath(edges, source, sink):
# create a weighted DAG - {node:[(cost,neighbour), ...]}
graph = collections.defaultdict(list)
for l, r, c in edges:
graph[l].append((c,r))
# create a priority queue and hash set to store visited nodes
queue, visited = [(0, source, [])], set()
@Overdrivr
Overdrivr / coords-ligne3-metro-toulouse.json
Created October 31, 2016 11:32
Coordonnées GPS estimées de la ligne 3 du métro de Toulouse (parcours validé a ce jour, il manque les parcours optionnels). Voir la carte
[
{name: 'Airbus Colommiers', coords: [43.6164113,1.3505030]},
{name: 'Airbus Saint Martin', coords: [43.6119056,1.3726646]},
{name: 'Jean Maga', coords: [43.6217381,1.3969560]},
{name: 'Espace Job', coords: [43.6164200,1.4076825]},
{name: 'Boulevard de suisse', coords: [43.6170028,1.4220444]},
{name: 'Fondeyre (estimation)', coords: [43.6294087,1.4294307]},
{name: 'La Vache SNCF', coords: [43.6346464,1.4398956]},
{name: 'Toulouse Lautrec (estimation)', coords: [43.6270672,1.4443802]},
{name: 'Raynal', coords: [43.6168462,1.4508390]},
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active April 15, 2025 03:42
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@ogrrd
ogrrd / dnsmasq OS X.md
Last active April 3, 2025 16:56
Setup dnsmasq on OS X

Never touch your local /etc/hosts file in OS X again

To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.

Requirements

Install

@pjdietz
pjdietz / Virtual Box Host Only Static IP.md
Created June 12, 2013 19:01
VirtualBox Host-Only Adapter with Static IP

VirtualBox Host-Only Static IP

My typical setup for a development box in VirtualBox uses two NICs. The first uses NAT to allow the box to communicate with the outside world through my host computer’s network connection. (NAT is the default, so shouldn't require any setup.) The second is a "host-only" connection that allows my host and guest to interact.

To create a host-only connection in VirtualBox, start by opening the preferences in VirtualBox. Go to the "Network" tab, and addd a Host-only Network. Modify the host-only network, and disable DHCP. Make a note of the IP address. (Feel free to set the IP address as well, if you like.)

Next, assign this host-only adapter to the virtual machine. Select the VM and press "Settings". Go to the "Network" tab, and select "Adpater 2". Enable the adapter, set it to a "Host-only Adapter", and select the adpater you created above.

Temporary

@yosemitebandit
yosemitebandit / meduele_login_with_requests.py
Created February 12, 2012 02:46
using the request lib's sessions to login; bonus: beautiful soup finds the csrf token
#!/usr/bin/env python
'''
testing a login to meduele using sessions
meduele checks csrf tokens with every request, even during login
'''
import requests
from BeautifulSoup import BeautifulSoup
# need to capture a valid csrf token
# first visit the login page to generate one