Skip to content

Instantly share code, notes, and snippets.

@apisandipas
apisandipas / share-urls.md
Last active May 5, 2024 09:30 — forked from chrisjlee/drupal-views-share-global-text-field
Share url's for Facebook, Twitter, Pinterest and Linkedin with just get variables

Creating share buttons with just URL's

Twitter

http://twitter.com/share?text=<TITLE>&url=<URL>

E.g. http://twitter.com/share?text=This+is+google+a+search+engine&url=https%3A%2F%2Fwww.google.com

Facebook

http://www.facebook.com/sharer.php?u=&amp;p[title]=

@mikaello
mikaello / git-commit-change-author-email.md
Last active May 5, 2024 09:28
Change Git commit author / email in existing commits

Docs: https://github.com/newren/git-filter-repo/blob/main/Documentation/converting-from-filter-branch.md#changing-authorcommittertagger-information and https://htmlpreview.github.io/?https://github.com/newren/git-filter-repo/blob/docs/html/git-filter-repo.html#_filtering_of_names_amp_emails_see_also_name_callback_and_email_callback

git filter-repo \
  --email-callback ' return email if email != b"OLD_EMAIL" else b"NEW_EMAIL" ' \
  --name-callback 'return name.replace(b"OLD_AUTHOR", b"NEW_AUTHOR")' \
  --force \
  --refs HEAD~<NUMBER_OF_COMMITS>..<BRANCH_NAME> # This line is optional, remove to do the change in all commits (will rewrite complete history)
@edy555
edy555 / RiehmanZetaRecursion.ipynb
Last active May 5, 2024 09:26
今度はリーマンゼータ関数の漸化式での計算をPythonで試してみた。前回のはこちら。http://nbviewer.jupyter.org/gist/edy555/9988efd898d11fba2540
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rkttu
rkttu / .bashrc
Last active May 5, 2024 09:25
How to initialize oh-my-posh with bash (macOS), bash (WSL, Ubuntu), cmd, zsh and pwsh
# for bash (macOS)
POSH_THEMES_PATH=$(brew --prefix oh-my-posh)/themes
eval "$(oh-my-posh completion bash)"
eval "$(oh-my-posh init bash --config "$POSH_THEMES_PATH"/clean-detailed.omp.json | sed 's|\[\[ -v MC_SID \]\]|[[ -n "$MC_SID" ]]|')"
@astamicu
astamicu / Remove videos from Youtube Watch Later playlist.md
Last active May 5, 2024 09:25
Script to remove all videos from Youtube Watch Later playlist

UPDATED 22.11.2022

It's been two years since the last update, so here's the updated working script as per the comments below.

Thanks to BryanHaley for this.

setInterval(function () {
    video = document.getElementsByTagName('ytd-playlist-video-renderer')[0];

 video.querySelector('#primary button[aria-label="Action menu"]').click();
@wojteklu
wojteklu / clean_code.md
Last active May 5, 2024 09:25
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@dawid-czarnecki
dawid-czarnecki / firefly-iii-backuper.sh
Last active May 5, 2024 09:18
Script to backup Firefly III database, uploads and config files installed with docker-compose
#!/bin/bash
files_to_backup=(.env .db.env .fidi.env docker-compose.yml )
info() { echo -e "\\033[1;36m[INFO]\\033[0m \\033[36m$*\\033[0m" >&2; }
warn() { echo -e "\\033[1;33m[WARNING]\\033[0m \\033[33m$*\\033[0m" >&2; }
fatal() { echo -e "\\033[1;31m[FATAL]\\033[0m \\033[31m$*\\033[0m" >&2; exit 1; }
intro () {
echo " ====================================================="
@cjddmut
cjddmut / EasingFunctions.cs
Last active May 5, 2024 09:12
Easing Functions for Unity3D
/*
* Created by C.J. Kimberlin
*
* The MIT License (MIT)
*
* Copyright (c) 2019
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
@cowboy
cowboy / inception.js
Last active May 5, 2024 09:10
JavaScript: inception(inception);
function inception(f) {
try {
return 'recursion puts the "' + f.name + '" in "' + f(f) + '"';
} catch (e) {
return '';
}
}
@piaoger
piaoger / maxstacksize.html
Created March 21, 2014 02:32
Get max call stack size in browser
<!-- A script to get max call stack size in browser
In my Macbook pro
Firefox 28:
maxStackSize = 350801 (dynamic, but always above 300000)
error: InternalError: too much recursion
Safari 7.0.2
maxStackSize = 58034
error: RangeError: Maximum call stack size exceeded.
Chrome 33: