bonus tip: for more darkness > https://darkreader.org/
// ==UserScript== | |
// @name Google maps addon | |
// @namespace http://tampermonkey.net/ | |
// @version 2024-03-21 | |
// @description Bring google maps button back | |
// @author You | |
// @match https://www.google.com/search* | |
// @include https://www.google.tld/search* | |
// @icon https://www.google.com/images/branding/googleg/1x/googleg_standard_color_128dp.png | |
// @grant none |
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 |
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() |
[ | |
{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]}, |
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.
- Homebrew
- Mountain Lion -> High Sierra
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.
#!/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 |