Skip to content

Instantly share code, notes, and snippets.

@beet
beet / Dashboard.md
Created April 30, 2022 05:36
Obsidian Templater script to convert the current line to a Tasks plugin task

Today

due today
not done
done today
// to install this script: install the tampermonkey extension. Then click on "raw" on this github page.
// *perso note:
//to install or to send update:
// 1/ edit must be done on github (cf. the url in the tab settings).
// 2/ Edit/update the script (using the edit github button) + increase the version (or it will ask to reinstall in the next step)
// (don't need to increase the version if the change are just for myself: just reinstall it to keep the version)
// 3/ click on RAW (it will show the changes).
// 4/ Click Update (if needed refresh the dashboard page)
@chamalis
chamalis / clean_pdf.sh
Created January 25, 2022 23:50
Remove metadata from PDF files, using pdftk, exiftool and qpdf
# Ensure that required tools are installed and available in $PATH
command -v pdftk >/dev/null 2>&1 || { echo >&2 "pdftk is required but was not found. Aborting."; exit 1; }
command -v exiftool >/dev/null 2>&1 || { echo >&2 "exiftool is required but was not found. Aborting."; exit 1; }
command -v qpdf >/dev/null 2>&1 || { echo >&2 "qpdf is required but was not found. Aborting."; exit 1; }
# Ensure that 1 cmdline argument was passed
if [ "$#" -ne 1 ]
then
echo "Usage: cleanpdf.sh path-to-pdf-file.pdf"
echo ""
@feliperugai
feliperugai / Windows Terminal settings.json
Last active December 26, 2022 14:22
Windows Terminal settings.json
// This file was initially generated by Windows Terminal 1.6.10571.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
@tykurtz
tykurtz / grokking_to_leetcode.md
Last active July 25, 2024 17:06
Grokking the coding interview equivalent leetcode problems

GROKKING NOTES

I liked the way Grokking the coding interview organized problems into learnable patterns. However, the course is expensive and the majority of the time the problems are copy-pasted from leetcode. As the explanations on leetcode are usually just as good, the course really boils down to being a glorified curated list of leetcode problems.

So below I made a list of leetcode problems that are as close to grokking problems as possible.

Pattern: Sliding Window

#!/bin/bash
COUNTER=1
SOURCE="source:/folder"
DESTINATION="destination:/folder"
while [ $COUNTER -lt 100 ]; do
@softon
softon / npp.bat
Created December 14, 2019 08:02
Notepad++ Compile and Execute Program (C,C++,JAVA,PYTHON)
npp_console 1 //open console
NPP_CONSOLE - //disable output of commands
npe_console m- //disable unnecessary output
con_colour bg= 191919 fg= F5F5F5 //set console colors
npp_save //save the file
cd $(CURRENT_DIRECTORY) //follow current directory
NPP_CONSOLE + //enable output
IF $(EXT_PART)==.c GOTO C //if .c file goto C label
IF $(EXT_PART)==.cpp GOTO CPP //if .cpp file goto CPP label
IF $(EXT_PART)==.java GOTO JAVA //if .java file goto JAVA label
@tingplenting
tingplenting / ffmpeg_tuts.md
Last active April 18, 2024 17:31
ffmpeg cli for youtube

Extract audio from a YouTube video file

ffmpeg -i INPUT.mp4 -ab 256k OUTPUT.mp3

Cut 3s length

ffmpeg -y -ss 00:00:03 -i INPUT.mp4 -codec copy OUTPUT.mp4
@WiliTest
WiliTest / some_google_doc_shortcuts_to_change_font_highlight.user.js
Last active March 26, 2024 10:34
some google doc shortcuts to change the font and highlights using a Userscript (works with ViolentMonkey)
// Help needed: I failed to send a value to the text resize and to apply it. Any idea ?
// to install this script: install the violentmonkey extension. Then click on "raw" on this github page.
// *perso note:
//to install or to send update:
// 1/ edit must be done on github (cf. the url in the tab settings).
// 2/ Edit/update the script (using the edit github button) + increase the version (or it will ask to reinstall in the next step)
// (don't need to increase the version if the change are just for myself: just reinstall it to keep the version)
// 3/ click on RAW (it will show the changes).
@scf37
scf37 / simulate_scanned_PDF.md
Created April 11, 2018 11:49
Simulate a scanned PDF with ImageMagick

Simulate a scanned PDF with ImageMagick

  1. Download and install Ghostscript and ImageMagick + Convert Module
  2. Execute the following command in the console (change the filename)
$ convert -density 200 INPUT.pdf -rotate 0.3 +noise Multiplicative -format pdf  -quality 85 -compress JPEG -colorspace gray OUTPUT.pdf

Description of the options

  • -density: set the input DPI to 200
  • -rotate: set Page rotation to 0.3 degrees