Skip to content

Instantly share code, notes, and snippets.

hdodov /
Created Nov 20, 2020
SuperHosting Kirby Git SSH setup instructions
  1. Open a terminal from cPanel

  2. Use ssh-keygen to generate a key (with no passphrase)

    Note: You can't use SuperHosting's GUI SSH key manager because it demands a passphrase, and that's not an option since kirby-git can't fill it in.

  3. Run cat ~/.ssh/ to print the public key and copy it

  4. Go to GitHub and paste the public key (in the Deploy Keys settings panel)

  5. Test with ssh -T -p 443

    Expected output:

hdodov / google-sheets-append-rows.php
Created Jan 9, 2020
Script that appends rows to a spreadsheet via the Google Sheets API.
View google-sheets-append-rows.php
require __DIR__ . '/vendor/autoload.php';
$creds = 'credentials.json';
$sheedId = '1IMwiyCa1gCfh1lacyzZqFrYFsqCe-hOSRlaHIc2gFDw';
$range = 'Sheet1';
$client = new Google_Client();
View v3.ext
keyUsage=digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
subjectAltName = @alt_names
hdodov / mixin-to-rule.scss
Created Jan 16, 2018
Regex to convert all SCSS mixins to simple CSS rules for transitioning from Bourbon to Autoprefixer.
View mixin-to-rule.scss
// Find (add properties as needed):
// Replace:
$1: $2;
// ----------------------------------
// Transforms this:
@include display(flex);
hdodov / iframechange.js
Last active May 7, 2021
HTML iframe URL change listener for tracking when a new iframe page starts to load
View iframechange.js
function iframeURLChange(iframe, callback) {
var lastDispatched = null;
var dispatchChange = function () {
var newHref = iframe.contentWindow.location.href;
if (newHref !== lastDispatched) {
lastDispatched = newHref;
hdodov / nomin.htaccess
Last active Nov 20, 2017
.htaccess file that allows you to visit a page with unminified versions of all files inside
View nomin.htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} \/nomin(\/|$)
RewriteRule (.+)\/nomin(.*) $1$2 [E=NO_MINIFICATION:1]
RewriteCond %{REQUEST_URI} (.+)\.min(\.[^.].*) [NC]
RewriteCond %{DOCUMENT_ROOT}/%1%2 -f
hdodov /
Last active Jun 13, 2017
How to completely remove an Android permission from Cordova app.

In this example, I'll show how to remove the RECORD_AUDIO permission.

  1. Navigate to the plugins directory in your Cordova folder.

  2. Open the plugin.xml file of each plugin and search for something like:

<uses-permission android:name="android.permission.RECORD_AUDIO"/>
hdodov /
Last active Jun 13, 2017
In-depth, step-by-step guide to building a Cordova release APK in Windows.
  1. Open CMD as administartor
  2. Go to your JDK's bin folder:
C:\Program Files\Java\jdk1.8.0_121\bin
  1. Run:
keytool -genkey -v -keystore C:\myKeystoreName.keystore -alias myName -keyalg RSA -keysize 2048 -validity 10000
  1. Add a build.json file to your Cordova folder (where the platforms and www folders reside). It should look like this:
hdodov / _media-smart.scss
Last active Dec 6, 2018
Flexible Sass media queries with no hardcoding. Specify your breakpoints and you'll have mixins for media queries that are smaller, larger or inside the device ranges. Mobile first (like Bootstrap).
View _media-smart.scss
// ----
// Sass (v3.4.21)
// Compass (v1.0.3)
// ----
$screens: (
"xs": 0px,
"sm": 768px,
"md": 992px,
"lg": 1200px