Skip to content

Instantly share code, notes, and snippets.

View johnnypea's full-sized avatar
🏠
Working from home

Ján Bočínec johnnypea

🏠
Working from home
View GitHub Profile
@johnnypea
johnnypea / karabiner.edn
Created March 29, 2022 21:09 — forked from narze/karabiner.edn
Goku config with SuperDuper mode (S+D)
{:templates {:alfred "osascript -e 'tell application \"Alfred 3\" to run trigger \"%s\" in workflow \"%s\" with argument \"\"'"
:km "osascript -e 'tell application \"Keyboard Maestro Engine\" to do script \"%s\"'"}
:simlayers {
:f-mode {:key :f}
:o-mode {:key :o}
:h-mode {:key :h}
:superduper-mode {:key :f20} ; Bind an unused key
}
:devices {:filco-bt [{:vendor_id 2652 :product_id 34050}]
:planck [{:vendor_id 65261 :product_id 24672}]
@johnnypea
johnnypea / karabiner.edn
Created March 29, 2022 21:09 — forked from narze/karabiner.edn
Goku config with SuperDuper mode (S+D)
{:templates {:alfred "osascript -e 'tell application \"Alfred 3\" to run trigger \"%s\" in workflow \"%s\" with argument \"\"'"
:km "osascript -e 'tell application \"Keyboard Maestro Engine\" to do script \"%s\"'"}
:simlayers {
:f-mode {:key :f}
:o-mode {:key :o}
:h-mode {:key :h}
:superduper-mode {:key :f20} ; Bind an unused key
}
:devices {:filco-bt [{:vendor_id 2652 :product_id 34050}]
:planck [{:vendor_id 65261 :product_id 24672}]
@johnnypea
johnnypea / useful-one-liners.sh
Last active April 4, 2024 20:00
Useful one liners
# Run the last command as root
sudo !!
# Serve current directory tree at http://$HOSTNAME:8000/
python -m SimpleHTTPServer
# Save a file you edited in vim without the needed permissions
:w !sudo tee %
# change to the previous working directory
cd -
# Runs previous command but replacing
^foo^bar
Verifying that "johnnypea.id" is my Blockstack ID. https://onename.com/johnnypea
@johnnypea
johnnypea / multiple-domains.php
Created April 26, 2017 14:43
WordPress wp-config.php customization for multiple domains
<?php
if (isset($_SERVER['HTTP_HOST'])) {
// HTTP is still the default scheme for now.
$scheme = 'http';
// If we have detected that the end use is HTTPS, make sure we pass that
// through here, so <img> tags and the like don't generate mixed-mode
// content warnings.
if (isset($_SERVER['HTTP_USER_AGENT_HTTPS']) && $_SERVER['HTTP_USER_AGENT_HTTPS'] == 'ON') {
$scheme = 'https';

Keybase proof

I hereby claim:

  • I am johnnypea on github.
  • I am johnnypea (https://keybase.io/johnnypea) on keybase.
  • I have a public key whose fingerprint is F091 9277 CF4A B78B 1975 F81D FB8A 471D 256B 27FC

To claim this, I am signing this object:

@johnnypea
johnnypea / 0_reuse_code.js
Created August 10, 2016 12:06
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<?php
/*
Plugin Name: My Plugin
Plugin URI: http://URI_Of_Page_Describing_Plugin_and_Updates
Description: This describes my plugin in a short sentence
Version: 1.0.0
Author: Webikon (John Doe)
Author URI: http://URI_Of_The_Plugin_Author
License: GPL2
License URI: https://www.gnu.org/licenses/gpl-2.0.html
@johnnypea
johnnypea / gist:8c5e13f5ddf7910e4c38
Last active August 29, 2015 14:23
Presmerovanie s parametrom v Contact Form 7
add_filter( 'wpcf7_load_js', '__return_false' );
class WPCF7_Submit_Redirect {
var $field; //nazov pola, napr. 'your-name'
var $url; //adresa, na ktoru sa presmeruje
var $form_id; //ID formularu
function __construct( $field, $url, $form_id = 0 ) {
$this->field = $field;
$this->url = $url;
Verifying myself: My Bitcoin username is +johnnypea. https://onename.io/johnnypea