Skip to content

Instantly share code, notes, and snippets.

View lindhe's full-sized avatar
🦥

Andreas Lindhé lindhe

🦥
View GitHub Profile
@lindhe
lindhe / Vimium configuration
Last active January 16, 2022 11:39
This are my current Vimium maps
unmapAll
map ? showHelp
# Scrolling:
map j scrollDown
map k scrollUp
map gg scrollToTop
map G scrollToBottom
map gl scrollToLeft
{"advancedControlPanel":true,"ACP_dogeButtons":false,"ACP_smileys":false,"ACP_specialChars":true,"ACP_usefulLinks":true,"ACP_quickLinks":true,"ACP_colorPalette":true,"addAEMUnloadConfirmation":true,"removeLastNewline":true,"autofocusTA":true,"removeMobileSiteDisclaimer":true,"autofocusPMSubject":true,"betterPaginationButtons":true,"highlightUnreadPMs":true,"addPMLinks":true,"quoteSignatureButtons":false,"fixAdHeight":true,"DOMOperationsDuringPageLoad":true,"enableFilter":true,"preventAccidentalSignout":true,"dogeInQuoteFix":true,"searchWithGoogle":true,"openImagesInNewTab":false,"enableFavoriteLinks":true,"darkThemeByBlargmode":true,"darkThemeCache":false,"textareaHeight":"360","largerTextareaHeight":"720","quoteSignatureTip":"Så, nu kvarstår trådens värde även när du byter signatur, så att andra lättare kan lösa samma problem i framtiden. Posta alltid specs i klartext i trådstarten, om de är relevanta. :)","uninterestingForumsRaw":"[]","favoriteLinksRaw":"### Better SweClockers\n Inställningar för Better S
@lindhe
lindhe / ErgoDox-EZ-Svorak-A1.kbd.json
Last active November 17, 2018 19:54
ErgoDox EZ Svorak A1
[
{
"name": "ErgoDox EZ Svorak A1",
"author": "Andreas Lindhé",
"switchMount": "cherry",
"switchBrand": "gateron",
"switchType": "KS-3-Green"
},
[
{
@lindhe
lindhe / vimfx.conf
Last active July 21, 2017 15:04
VimFX laptop.home 2017-07-21
{
"prevent_autofocus": true,
"blacklist": "*example.com* *192.168.0.112:8006* *docs.google.com/* http://www.foddy.net/Athletics.html https://2017game.picoctf.com/game/*",
"hints.chars": "asdfjklweio nv",
"mode.normal.copy_current_url": "Y yy",
"mode.normal.go_home": "",
"mode.normal.history_back": "L s",
"mode.normal.history_forward": "Ö d",
"mode.normal.stop": "",
"mode.normal.scroll_right": "",
@lindhe
lindhe / patch.md
Last active September 13, 2021 08:03
Guide to git patches

Guide to sending Git repos and patches

$ git bundle create /tmp/foo-all --all (http://stackoverflow.com/a/2545784/893211)

Andreas Lindhé, [03.03.17 20:08]

  1. Ladda ned repo.git filen.
  2. git clone repo.git git_is_cool
  3. Redan detta är coolt. Jag skickade just en komprimerad variant av ett git-repo, och du klonade från det repot.
  4. Ladda ned patch.diff filen.
@lindhe
lindhe / dateHelpers.gs
Last active January 5, 2019 21:02
Google Scripts form email helper functions
// -*- coding: utf-8 -*-
// vim: syntax=javascript tabstop=2
function nothing() {
// Triggers don't like files with no named function.
Logger.log("Nothing happened.\n");
};
Date.prototype.getWeekNumber = function() {
// http://stackoverflow.com/questions/6117814/get-week-of-year-in-javascript-like-in-php
@lindhe
lindhe / confirmation.gs
Created May 13, 2017 20:08
Automatic email confirmation for Google Forms
function confirmation(e){
const TIME = 0;
const NAME = 1;
const EMAIL = 2;
var userName = e.values[NAME];
var userEmail = e.values[EMAIL];
var subject = "Form Submitted";
var message = "Thank you," + userName + "for registering!";
MailApp.sendEmail (userEmail, subject, message);
@lindhe
lindhe / Validity90-prototype_2273db1
Created June 11, 2017 12:08
Output from reverse engineered diver for finger print reader
Prototype version 7
Found device 138a:0097
This device is not supported, but lets try anyway
[C]
Index 1, size 12
0000 66 30 64 66 38 63 65 64 35 34 32 36
usb write:
0000 01
usb read:
0000 00 00 f0 b0 5e 54 a4 00 00 00 06 07 01 30 00 01
@lindhe
lindhe / Validity90-prototype_e9dd5ba
Created June 12, 2017 20:04
Output from reverse engineered diver for finger print reader
Prototype version 10
Found device 138a:0097
This device is not supported, but lets try anyway
Index 1, size 12
0000 66 30 64 66 38 63 65 64 35 34 32 36
usb write:
0000 01
usb read:
0000 00 00 f0 b0 5e 54 a4 00 00 00 06 07 01 30 00 01
@lindhe
lindhe / check_network_before_backup.sh
Last active July 2, 2017 17:56
Checks for authorized Wi-Fi SSID or connected Ethernet before performing backup.
#!/bin/bash
# Checks for authorized Wi-Fi SSID or connected Ethernet before performing
# backup.
RUN=false;
AUTHFILE=~/.config/authorized_netwoks.txt;
WIFI=$(iwgetid --raw);
ETH_IF=eth0;
ETH=$(ip link show $ETH_IF | perl -n -e'/state (\w+)/ && print $1');