Skip to content

Instantly share code, notes, and snippets.

View kirnbauer's full-sized avatar

kirnbauer

  • Austria
  • 11:17 (UTC +01:00)
View GitHub Profile
@theodorosploumis
theodorosploumis / Nework_throttling_profiles.md
Last active September 5, 2025 19:01
Web development - Custom network throttling profiles
Profile download (kb/s) upload (kb/s) latency (ms)
Native 0 0 0
GPRS 50 20 500
56K Dial-up 50 30 120
Mobile EDGE 240 200 840
2G Regular 250 50 300
2G Good 450 150 150
3G Slow 780 330 200
@feliciaceballos
feliciaceballos / functions.php
Created March 12, 2019 07:23
WordPress Login Page redirect to Home Page
<?php
//remove <?php when you paste inside your functions.php file
function admin_login_redirect( $redirect_to, $request, $user ) {
global $user;
if( isset( $user->roles ) && is_array( $user->roles ) ) {
if( in_array( "administrator", $user->roles ) ) {
return $redirect_to;
}
@yangshun
yangshun / docusaurus-copy-button.md
Last active April 4, 2023 07:07
How to add the "Copy" button to code blocks in Docusaurus

Adding "Copy" (to Clipboard) Button

If you would like to add a button to your fenced code blocks so that users may copy the code, you can do so in Docusaurus. You will have to add some code to your Docusaurus project, as seen below.

Under static/js, create a file called code-block-buttons.js with the following:

// Turn off ESLint for this file because it's sent down to users as-is.
/* eslint-disable */
window.addEventListener('load', function() {
@dylanmckay
dylanmckay / facebook-contact-info-summary.rb
Last active July 3, 2025 21:22
A Ruby script for collecting phone record statistics from a Facebook user data dump
#! /usr/bin/env ruby
# NOTE: Requires Ruby 2.1 or greater.
# This script can be used to parse and dump the information from
# the 'html/contact_info.htm' file in a Facebook user data ZIP download.
#
# It prints all cell phone call + SMS message + MMS records, plus a summary of each.
#
# It also dumps all of the records into CSV files inside a 'CSV' folder, that is created
@MwieMarin
MwieMarin / functions.php
Last active October 24, 2024 05:24
WordPress: Add timestamp to CSS and JS
<?php
// Version CSS file in a theme
wp_enqueue_style( 'theme-styles', get_stylesheet_directory_uri() . '/style.css', array(), filemtime( get_stylesheet_directory() . '/style.css' ) );
// Version JS file in a theme
wp_enqueue_script( 'theme-scripts', get_stylesheet_directory_uri() . '/js/scripts.js', array(), filemtime( get_stylesheet_directory() . '/js/scripts.js' ) );
// Version CSS file in a plugin
wp_enqueue_style( 'plugin-styles', plugin_dir_url( __FILE__ ) . 'assets/css/plugin-styles.css', array(), filemtime( plugin_dir_path( __FILE__ ) . 'assets/css/plugin-styles.css' ) );
// Version JS file in a plugin
wp_enqueue_script( 'plugin-scripts', plugin_dir_url( __FILE__ ) . 'assets/js/plugin-scripts.js', array(), filemtime( plugin_dir_path( __FILE__ ) . 'assets/js/plugin-scripts.js' ) )
@marcinlerka
marcinlerka / eu_vat_numbers_regex
Created August 23, 2017 09:40
eu vat numbers regex
'AT': (/^(AT)(U\d{8}$)/i), // Austria
'BE': (/^(BE)(\d{10}$)/i), // Belgium
'BG': (/^(BG)(\d{9,10}$)/i), // Bulgaria
'CY': (/^(CY)([0-5|9]\d{7}[A-Z]$)/i), // Cyprus
'CZ': (/^(CZ)(\d{8,10})?$/i), // Czech Republic
'DE': (/^(DE)([1-9]\d{8}$)/i), // Germany
'DK': (/^(DK)(\d{8}$)/i), // Denmark
'EE': (/^(EE)(10\d{7}$)/i), // Estonia
'EL': (/^(EL)(\d{9}$)/i), // Greece
'ES': (/^(ES)([0-9A-Z][0-9]{7}[0-9A-Z]$)/i), // Spain
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active November 1, 2025 05:06 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy

Exporting your 2FA tokens from Authy to transfer them into another 2FA application

IMPORTANT - Update regarding deprecation of Authy desktop apps

Past August 2024, Authy stopped supported the desktop version of their apps:
See Authy is shutting down its desktop app | The 2FA app Authy will only be available on Android and iOS starting in August for details.

And indeed, after a while, Authy changed something in their backend which now prevents the old desktop app from logging in. If you are already logged in, then you are in luck, and you can follow the instructions below to export your tokens.

If you are not logged in anymore, but can find a backup of the necessary files, then restore those files, and re-install Authy 2.2.3 following the instructions below, and it should work as expected.

@seoagentur-hamburg
seoagentur-hamburg / .htaccess
Last active October 6, 2025 02:36
UPDATE 2024/03: Perfect .htaccess file for highspeed and security. You can use it for every WordPress-Website without problems. Highspeed and Security - testet on hundreds of Websites. If you are using a WordPress Multisite, change the last part of this file.
########################################################################
# OPTIMAL .htaccess FILE FOR SPEED AND SECURITY @Version 2.0.9 - 03/2024
# ----------------------------------------------------------------------
# @Author: Andreas Hecht
# @Author URI: https://seoagentur-hamburg.com
# License: GNU General Public License v2 or later
# License URI: http://www.gnu.org/licenses/gpl-2.0.html
########################################################################
@rublev
rublev / remove-gh-stars.js
Created April 7, 2017 22:36
remove all github stars
// open console and run cmd+v every time
var i = 0;
var el = document.querySelectorAll('[aria-label="Unstar this repository"]');
function myLoop () {
setTimeout(function () {
el[i].click()
i++;
if (i < 30) {
@Shelob9
Shelob9 / caldera_forms_field_attributes-add-attr.php
Last active September 2, 2024 22:43
Examples of how to use the Caldera Forms filter caldera_forms_field_attributes to modify Caldera Forms input elements. See: https://calderaforms.com/doc/caldera_forms_field_attributes/
<?php
add_filter( 'caldera_forms_field_attributes', function( $attrs, $field, $form ){
if( 'button' === Caldera_Forms_Field_Util::get_type( $field, $form ) ){
$attrs[ 'data-form-id' ] = $form[ 'ID' ];
}
return $attrs;
}, 20, 3 );