Skip to content

Instantly share code, notes, and snippets.

View rensjaspers's full-sized avatar

Rens Jaspers rensjaspers

View GitHub Profile
@rensjaspers
rensjaspers / disable-click-event-listeners.js
Created June 12, 2019 17:52
Disable click event listeners
(()=>{
window.addEventListener("click", event => {
event.stopPropagation();
}, true);
})();
@rensjaspers
rensjaspers / put-calendar-events-in-sheet.gs
Created April 9, 2019 15:02
Get list of calendar events and put them in a spreadsheet
// Compiled using ts2gas 1.6.0 (TypeScript 3.3.3333)
var exports = exports || {};
var module = module || { exports: exports };
var startCol = 1;
var endCol = 2;
var titleCol = 3;
function main() {
var events = getEventsNext365Days();
putEventsInSheet(events);
}
@rensjaspers
rensjaspers / slowly-rotate-page.js
Last active February 23, 2023 03:47
Slowly rotate page prank
(function(){
var deg = 1;
var body = document.getElementsByTagName("body")[0];
body.style.overflow = "hidden";
body.style.transition = "1000ms linear all";
setInterval(function() {
body.style.transform = `rotate(${deg/5}deg)`;
deg ++;
},1000);
find . -name "*.jpg" | xargs mogrify -strip -interlace Plane -sampling-factor 4:2:0 -resize '2073600@>' -quality 85%
@rensjaspers
rensjaspers / mydotfiles-setup.sh
Last active November 18, 2019 16:44
Quickly install dotfiles
#!/bin/bash
git clone --bare git@github.com:rensjaspers/dotfiles.git $HOME/.mydotfiles
function mydotfiles {
/usr/bin/git --git-dir=$HOME/.mydotfiles/ --work-tree=$HOME $@
}
mydotfiles checkout
mydotfiles config status.showUntrackedFiles no
mydotfiles submodule init
mydotfiles submodule update --remote --recursive
@rensjaspers
rensjaspers / install-skippy-xd.sh
Created July 14, 2017 08:11
Install Skippy-XD (full-screen Exposé-style standalone task switcher for X11) on Lubuntu 17
#!/bin/bash
sudo apt install libimlib2-dev libfontconfig1-dev libfreetype6-dev libx11-dev libxext-dev libxft-dev libxrender-dev zlib1g-dev libxinerama-dev libxcomposite-dev libxdamage-dev libxfixes-dev libxmu-dev git
cd /tmp
git clone https://github.com/richardgv/skippy-xd.git
cd skippy-xd
make
sudo make install
@rensjaspers
rensjaspers / install-select-recordgif.sh
Last active July 14, 2017 08:13
Install create gif of selection on screen (Ubuntu)
# get dependencies for this script
sudo apt install byzanz git dh-autoreconf libx11-dev
# get xrectsel to make selection on screen
git clone https://github.com/lolilolicon/xrectsel
cd xrectsel
./bootstrap # required if ./configure is not present
./configure --prefix /usr
make
sudo make DESTDIR="$directory" install
@rensjaspers
rensjaspers / remove-other-search-engines.js
Created June 24, 2017 10:23
Remove other search engines from Google Chrome
/*
1. ) Go to chrome://settings/searchEngines
2. ) Press Ctrl+Shift+J (or ⌥+⌘+J (Option+Command+J) if you're using Mac OS X)
3. ) Paste this script and press ENTER.
You may have to repeat step 3 two or three times.
*/
var otherSearchEngineList = document.getElementById('other-search-engine-list');
var d = otherSearchEngineList.getElementsByClassName("row-delete-button");
d = Array.prototype.slice.call(d);
@rensjaspers
rensjaspers / insert-date.gs
Created June 14, 2017 11:34
Insert dd-mm-yyyy date in Google Doc
function onInstall(e) {
onOpen(e);
}
function onOpen() {
DocumentApp.getUi().createMenu('Utilities')
.addItem('Insert today\'s date', 'insertDate')
.addToUi();
}
@rensjaspers
rensjaspers / Accept all changes in Google Docs
Created April 25, 2017 14:38
Add this line of code to your bookmarks and use it to accept all changes in Google Docs
javascript:(function(){ var d=document.getElementsByClassName("docos-accept-suggestion"); d = Array.prototype.slice.call(d); d.forEach(function(n){ var e = document.createEvent("MouseEvents"); e.initEvent("click", true, false); n.dispatchEvent(e,true); e = document.createEvent("MouseEvents"); e.initEvent("mousedown", true, false); n.dispatchEvent(e,true); e = document.createEvent("MouseEvents"); e.initEvent("mouseup", true, false); n.dispatchEvent(e,true); }); })();