Skip to content

Instantly share code, notes, and snippets.

CITY 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
1 0
2 3 0
3 2 14 0
4 8 13 3 0
5 21 10 4 38 0
6 2 4 23 67 5 0
7 10 35 5 48 12 51 0
8 5 24 14 2 38 21 10 0
9 98 2 5 21 45 56 75 19 0
cmake_minimum_required(VERSION 2.8.3)
project(spiff)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED)
@pveierland
pveierland / gist:ed8e9d91bbb5554a7047ea5eaeac83e5
Created June 11, 2021 10:11
G suite hide participants bookmarklet
javascript:(function(){document.head.appendChild(document.createElement("style")).innerHTML='#docs-presence-container, g[clip-path="url(#punch-page-filmstrip-thumbnail-collaborator-clip-path)"]{display: none !important;}'})();
import datetime
import uavcan
run_start_time = datetime.datetime.utcnow().strftime("%Y%m%dT%H%M%SZ")
node = uavcan.make_node('/dev/ttyS12', bitrate=250000, baudrate=3000000)
log_file_registry = dict()
def build_log_filename(uavcan_type):
@pveierland
pveierland / JLinkExe
Last active July 11, 2021 14:57
WSL JLinkExe + JLinkGDBServer
#!/usr/bin/env python
import os
import re
import shutil
import subprocess
import sys
windows_working_directory = '/mnt/c/tmp/'
@pveierland
pveierland / jflash
Created July 11, 2021 14:56
WSL jflash + jreset
#/usr/bin/env bash
set -x
cat << EOF > /mnt/c/tmp/flash.jlink
r
loadbin ${1##*/}, 0x8000000
r
go
q
@pveierland
pveierland / gh-repo-mirror-all.bash
Created September 28, 2021 14:03
gh-repo-mirror-all.bash
#!/usr/bin/env bash
exec ssh-agent bash &
ssh-add
gh repo list "${1}" --limit 9999 | while read -r repo _; do
gh repo clone "$repo" -- --mirror
done
#!/bin/bash
# SET THIS TO BE YOUR DESIRED USERNAME
export MY_USER_NAME_FOR_CERT=`whoami`
# This directory is optional, but will use it to keep the CA root key safe
mkdir keys certs
chmod og-rwx keys certs
# Set up a directory that will serve as the pgconf mount
@pveierland
pveierland / encrypt_password.py
Created April 30, 2022 09:48 — forked from jkatz/encrypt_password.py
Methods to create password verifiers for PostgreSQL
# Copyright 2019-2022 Jonathan S. Katz
#
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@pveierland
pveierland / vscode-hack.nix
Last active August 9, 2022 18:13
VSCode Nix Home Manager Settings Hack
{ config, lib, ... }:
let
codeSettingsPath = "${config.home.homeDirectory}/.config/Code/User/settings.json";
in
{
home.activation.codeSettingsHackRemove = lib.hm.dag.entryBefore [ "checkLinkTargets" ] ''
if [ -e "${codeSettingsPath}" ]; then
rm -f "${codeSettingsPath}"
fi
'';