Skip to content

Instantly share code, notes, and snippets.

View josefandersson's full-sized avatar
⛩️
Hehe

Josef Andersson josefandersson

⛩️
Hehe
View GitHub Profile

Keybase proof

I hereby claim:

  • I am josefandersson on github.
  • I am drdoof (https://keybase.io/drdoof) on keybase.
  • I have a public key whose fingerprint is 0AA9 2F85 6264 589A A811 4CB7 FE8E 0A40 9676 2A1D

To claim this, I am signing this object:

@josefandersson
josefandersson / hfcharactercount.user.js
Last active December 20, 2016 20:23
A userscript for counting characters in a post! (In the same way the server counts characters in a post.)
// ==UserScript==
// @name HF Character Counter
// @description Counts the number of characters in a post or PM on Hackforums.net!
// @author Josef A. (DrDoof)
// @namespace https://github.com/josefandersson
// @require https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js
// @include *://hackforums.net/*
// @grant GM_addStyle
// @grant GM_setValue
// @grant GM_getValue
@josefandersson
josefandersson / 4chenenhancedwebmcontrols.user.js
Last active June 4, 2016 23:29
Makes the webm player a little bit better on 4chan. Click video to pause/play. Scoll on playing video to change volume. Playing a video will pause an already playing video. More responsive to pausing a video that is out of view.
// ==UserScript==
// @name 4chen Enhanced Webm Controls
// @description Adds some new features to the webm player.
// @author Josef A. (DrDoof)
// @namespace https://gist.github.com/josefandersson/ec3d2826d20337d3fba21e893b83b181/raw/9f4c7affaf4628f2a15165a7cb3bb9ba62a309f3/4chenenhancedwebmcontrols.user.js
// @require https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js
// @include http://*.4chan.org/*
// @include https://*.4chan.org/*
// @grant GM_addStyle
// @grant GM_setValue
@josefandersson
josefandersson / remove_diacritics.js
Created July 22, 2016 10:51
A js function for replacing diacritics with their 'real' letter.
// A function for replacing diacritics with their 'real' letter.
function removeDiacritics (str) {
// A table of diacritics (as unicode) and the 'real' letter they are associated with.
var diacriticsTable = {
A :/[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g,
AA:/[\uA732]/g,
AE:/[\u00C6\u01FC\u01E2]/g,
AO:/[\uA734]/g,
AU:/[\uA736]/g,
AV:/[\uA738\uA73A]/g,
.qr_inp {
padding: 3px 6px;
width: calc(100% - 15px);
background: white;
font-size: 14px;
border: 1px solid black;
color: #413c3c;
margin: 2px 0 5px 0;
} .qr_btn, .qr_sel {
cursor: pointer;
// ==UserScript==
// @name HF Keyboard Shortcuts
// @namespace https://github.com/josefandersson/hf_keyboard_shortcuts
// @version 1.0.0
// @description Use your keyboard to quickly navigate hackforums using a ton of shortcuts.
// @author DrDoof
// @match *://hackforums.net/*
// @require https://craig.global.ssl.fastly.net/js/mousetrap/mousetrap.min.js
// @require https://code.jquery.com/jquery-3.1.0.min.js
// @grant GM_addStyle
// ==UserScript==
// @name HF image size restriction
// @version a
// @description Don't allow images in threads to be wider than the page.
// @author DrDoof
// @match https://hackforums.net/showthread.php*
// @match http://hackforums.net/showthread.php*
// @grant GM_addStyle
// ==/UserScript==
@josefandersson
josefandersson / hf_real_ignore_user.userscript.js
Last active February 1, 2020 13:40
Remove the posts of users you ignore completely and not just hide it
// ==UserScript==
// @name Real Ignore User
// @namespace https://gist.github.com/josefandersson/
// @version 1337.1
// @description Remove the posts of users you ignore completely and not just hide it.
// @author DrDoof
// @icon https://hackforums.net/favicon.ico
// @match https://hackforums.net/showthread.php?*
// @grant GM_addStyle
// ==/UserScript==
@josefandersson
josefandersson / commits_editor.userscript.js
Created January 17, 2020 23:56
GitHub Draw on Commits Calendar Graph in Profile (userscript)
// ==UserScript==
// @name Commits Editor
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://github.com/*
// @grant none
// ==/UserScript==
@josefandersson
josefandersson / switch-windows-monitors.ahk
Created February 1, 2020 03:14
Move open windows from one monitor to the other on dual monitor setups
WinGet, windows, List
Loop %windows%
{
id := windows%A_Index%
WinGetPos, x, y,,, ahk_id %id%
WinGetTitle, wt, ahk_id %id%
StringLen, tl, wt
If tl > 0 And WinExist("ahk_id" . id)
{
If x < -8