Skip to content

Instantly share code, notes, and snippets.

View kussberg's full-sized avatar

Edgar Kussberg kussberg

View GitHub Profile
@kussberg
kussberg / sign.sh
Created October 4, 2021 21:49
Resign GPG previous commits
// That will override your previous commits with signed commits
git rebase --exec 'git commit --amend --no-edit -n -S' -i <COMMIT_ID>
git push --force
@kussberg
kussberg / functions.php
Last active November 10, 2020 13:47
Wordpress: Enable SVG in Media; Fix slug conflict of attachments and posts; Redirect media to files
// Allow SVG in Media
function cc_mime_types($mimes) {
$mimes['svg'] = 'image/svg+xml';
return $mimes;
}
add_filter('upload_mimes', 'cc_mime_types');
// Redirect media pages to source files
add_action( 'template_redirect', 'test_attachment_redirect', 10 );
function test_attachment_redirect() {
@kussberg
kussberg / cloudSettings
Last active November 11, 2020 09:33
VSCode
{"lastUpload":"2020-11-11T09:33:36.494Z","extensionVersion":"v3.4.3"}
@kussberg
kussberg / multiple-convert-to-markdown.js
Last active August 15, 2019 12:40 — forked from bnb/convert-to-markdown.js
This script converts Google Docs to Markdown files.
/*
Usage:
Adding this script to your doc:
- Tools > Script Manager > New
- Select "Blank Project", then paste this code in and save.
Running the script:
- Tools > Script Manager
- Select "ConvertToMarkdown" function.
- Click Run button.
- Converted doc will be mailed to you. Subject will be "[MARKDOWN_MAKER]...".
@kussberg
kussberg / invite_post_likers.js
Last active November 17, 2016 17:36
Facebook invite people, who liked the post
function invitePeople() {
// Invite first page users
var inputs = document.querySelectorAll('div._4t2a a._42ft._4jy0._4jy3._517h');
for(var i=1; i<inputs.length;i++) {
inputs[i].click();
}
// Are there more users?
var moreBtn = document.querySelector('div._4t2a a.pam.uiBoxLightblue.uiMorePagerPrimary');
if(moreBtn) {