Skip to content

Instantly share code, notes, and snippets.

View john2ksonn's full-sized avatar
👨‍💻
Haha code goes brrr

john2ksonn

👨‍💻
Haha code goes brrr
View GitHub Profile
@john2ksonn
john2ksonn / LICENSE
Created October 17, 2024 20:04
hledger timeclock to gitlab timetracking comments
GLWT(Good Luck With That) Public License
Copyright (c) Everyone, except Author
Everyone is permitted to copy, distribute, modify, merge, sell, publish,
sublicense or whatever they want with this software but at their OWN RISK.
Preamble
The author has absolutely no clue what the code in this project does.
It might just work or not, there is no third option.
javascript: (function() {window.location.href = "https://www.youtube.com/feeds/videos.xml?channel_id=%22%20+%20document.body.innerHTML.match(%22channelId\%22:\%22([^\%22]*)%22)[1];}());
@john2ksonn
john2ksonn / copy_notes.sh
Last active April 18, 2022 12:33
Moodle grading scripts
#!/bin/sh
# Run this script to quickly retrieve the moodle grading_notes.txt files from graded moodle submissions.
# The script will prompt you for the group directory name in fzf and copy the contents of grading_notes.txt to your clipboard.
# clip.exe only works with WSL.
# On a pure linux install, you would need to use xclip
#while true; do cat "`find -name 'grading_notes.txt' | fzf`" | clip.exe; done
while true; do cat "`find -name 'grading_notes.txt' | fzf --no-mouse`" | xclip -selection clip; sleep 0.5; done
@john2ksonn
john2ksonn / m5stickc_presentation_remote_pointer.ino
Last active October 3, 2021 11:18
M5StickC presentation pointer
#include <BleMouse.h>
#include <M5StickC.h>
#define SLEEP_COUNTER_LIMIT 500
// max brightness is 12
#define SCREEN_BRIGHTNESS 10
#define LOW 1
#define HIGH 0
float getBatteryPercentage();
@john2ksonn
john2ksonn / enfuse_brackets.sh
Created May 6, 2020 10:52
ML / Imagemagick / Hugin scripts
#!/bin/sh
# This is a simple shell script to enfuse brackets shot with Magic Lantern.
# It requires the "File List" Post script from ML. It can be found in ML under Shoot >> Shoot Preferences >> Post scripts.
# author: john2ksonn
suffix="_enfused.jpg"
for folder in "$@"
do
@john2ksonn
john2ksonn / winopen
Created April 27, 2020 16:46
WSL scripts
#!/bin/sh
# A simple shell script for Windows Subsystems to open files and folders in Windows
# Author: john2ksonn
# use $PWD if no argument was given
[ -z "$1" ] && set $1 "$PWD"
# convert the unix path to a windows path
wslpath=$(wslpath -wa "$1")
@john2ksonn
john2ksonn / Shortcuts.md
Last active July 30, 2018 14:27
Shortcuts

Shortcuts

IntelliJ

  • Run Shift + F10
  • Stop Ctrl + F2
  • Alt + Enter
  • Ctrl + Space
  • sout + Enter -> System.out.println();
  • Ctrl + Click on Variable / Mehod / Class... -> Usage / Implementation
  • Settings Ctrl + Alt + S
  • Project Structure Ctrl + Alt + Shift + S
@john2ksonn
john2ksonn / SQL.md
Last active July 6, 2018 14:52
SQL Cheatsheet

List Databases

SHOW DATABASES;

Import Database

USE <db_name>;
source path/to/file.sql;

Show table's columns

SHOW COLUMNS FROM mytable FROM mydb;

@john2ksonn
john2ksonn / console services.md
Last active July 6, 2018 14:53
Console Services
@john2ksonn
john2ksonn / Keil.gitignoe
Created December 13, 2017 18:36 — forked from IvanZuy/Keil.gitignoe
.gitignore for Keil project.
*.axf
*.htm
*.Inp
*.map
*.tra
*.dep
*.__i
*.crf
*.d
*.o