Skip to content

Instantly share code, notes, and snippets.

View idarek's full-sized avatar

Dariusz Więckiewicz idarek

View GitHub Profile
@gregrickaby
gregrickaby / remove-woocommerce-styles-scripts.php
Last active April 25, 2024 09:45
Remove WooCommerce styles and scripts.
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below into functions.php
/**
* Manage WooCommerce styles and scripts.
*/
function grd_woocommerce_script_cleaner() {
// Remove the generator tag
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) );
@zabbarob
zabbarob / 7-zip-default-extract.reg
Last active March 1, 2024 08:35
Make 7-Zip extract to folder when double-clicking archives. (based on http://superuser.com/a/447791)
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\7-Zip.001\shell]
@="extract"
[HKEY_CLASSES_ROOT\7-Zip.001\shell\extract]
@="Extract to Folder"
[HKEY_CLASSES_ROOT\7-Zip.001\shell\extract\command]
@="\"C:\\Program Files\\7-Zip\\7zG.exe\" x \"%1\" -o*"
[HKEY_CLASSES_ROOT\7-Zip.7z\shell]
@basham
basham / css-units-best-practices.md
Last active July 24, 2024 01:51
CSS Units Best Practices

CSS units

Recommendations of unit types per media type:

Media Recommended Occasional use Infrequent use Not recommended
Screen em, rem, % px ch, ex, vw, vh, vmin, vmax cm, mm, in, pt, pc
Print em, rem, % cm, mm, in, pt, pc ch, ex px, vw, vh, vmin, vmax

Relative units

Relative units

@adactio
adactio / minimal-serviceworker.js
Last active August 18, 2023 09:15
An attempt at a minimal viable service worker.
// Licensed under a CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
// http://creativecommons.org/publicdomain/zero/1.0/
// HTML files: try the network first, then the cache.
// Other files: try the cache first, then the network.
// Both: cache a fresh version if possible.
// (beware: the cache will grow and grow; there's no cleanup)
const cacheName = 'files';
@zthxxx
zthxxx / Activate Office 2019 for macOS VoL.md
Last active July 27, 2024 09:08
crack activate Office on mac with license file
@DavidKuennen
DavidKuennen / minimal-analytics-snippet.js
Last active June 9, 2024 19:08
Minimal Analytics Snippet
(function (context, trackingId, options) {
const history = context.history;
const doc = document;
const nav = navigator || {};
const storage = localStorage;
const encode = encodeURIComponent;
const pushState = history.pushState;
const typeException = 'exception';
const generateId = () => Math.random().toString(36);
const getId = () => {
@RiodeJaneiroo
RiodeJaneiroo / functions.php
Last active January 31, 2023 13:12
[Wordpress Default link image media] in Gutenberg set default in image link media #wp #wordpress #gutenberg
function setDefaultHrefImage() {
wp_enqueue_script(
'modify-image-link-destination-default',
get_template_directory_uri() . '/js/setDefaultHrefImage.js',
array('wp-hooks')
);
}
add_action('enqueue_block_editor_assets', 'setDefaultHrefImage');
@ayyybe
ayyybe / ccdl.command
Last active July 26, 2024 18:52
Adobe Offline Package Builder v0.1.2 (macOS only) --- No longer being maintained.
#!/bin/bash
CYAN="$(tput bold; tput setaf 6)"
RESET="$(tput sgr0)"
clear
if command -v python3 > /dev/null 2>&1; then
if [ $(python3 -c "print('ye')") = "ye" ]; then
clear

An account of how to create a USB disk that will boot a Linux 4.19 kernel (based off Chrome OS' most recent working kernel) on an Asus C100PA with a Debian ("buster") root file system. This may also work on other veyron-* devices.

Setup USB Disk

In this first step we will create a Chrome OS GPT partition table on USB drive that looks like this:

      start        size    part  contents
           0           1          PMBR
           1           1          Pri GPT header

Forked from kapilhp/linux_on_c100pa.md with my modifications as commentes on the main Gist.

An account of how to create a USB disk that will boot a Linux 4.19 kernel (based off Chrome OS' most recent working kernel) on an Asus C100PA with a Debian ("buster") root file system. This may also work on other veyron-* devices.

Setup USB Disk

In this first step we will create a Chrome OS GPT partition table on USB drive that looks like this:

      start        size    part  contents