Skip to content

Instantly share code, notes, and snippets.

View moso's full-sized avatar

Morten Sørensen moso

View GitHub Profile
@moso
moso / bootstrap3.sublime-snippet
Created December 3, 2017 16:41
Sublime Snippets
<snippet>
<content><![CDATA[
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<meta name="description" content="">
<meta property="og:description" content="">
<meta property="og:title" content="">
@moso
moso / browserprivacy.md
Last active April 1, 2018 17:41
Browser extensions and -privacy settings

Extensions

Adblocking

uBlock Origin

An efficient blocker. Easy on CPU and memory.

Antitracking

Privacy Badger
@moso
moso / README.md
Last active May 21, 2024 00:45
Sass: remove the Material Design Icons cache-busting version string

Removing the cache-busting version string from Material Design Icons with Sass

I like to use webpack and npm. And since Material Design Icons has a nice and neat npm package, I usually just import it. However, if you want a higher score on, eg, PageSpeed or Pingdom, you'll need to get rid of the ?v=<version>-string, as they see the version string as socalled cache busting.

Modifying the output CSS file manually isn't the right solution, as we want something automated. And we do, since we're using webpack in the first place. So we'll insert the content of the node_modules/mdi/scss/materialdesignicons into our own _mdi.scss-file, and exchange the parts that contains the nasty version string. This way we don't have to maintain a copy of Material Design Icons or any of their files, and it's not going to break any updates from their side.

The version string resides inside node_modules/mdi/scss/_path.scss, which contains the @font-face-selector we want to edit. So by copying the seletor into our n

@moso
moso / git-init.txt
Created March 22, 2017 13:56
git init
git init
git add --all
git commit -m "Initial Commit"
git remote add origin ssh://<url>
git push -u origin master
@moso
moso / functions.php
Created March 22, 2017 13:03
Bootstrap 4 Navbar Walker for WordPress
<?php
// BOOTSTRAP 4 NAVBAR INTEGRATION
class bs4_walker_nav_menu extends Walker_Nav_menu {
function start_lvl( &$output, $depth = 0, $args = array() ){ // ul
$indent = str_repeat("\t",$depth); // indents the outputted HTML
$submenu = ($depth > 0) ? ' sub-menu' : '';
$output .= "\n$indent<ul class=\"dropdown-menu$submenu dropdown-menu-right depth_$depth\">\n";
}
function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ){ // li a span
$indent = ( $depth ) ? str_repeat("\t",$depth) : '';
@moso
moso / README.md
Last active March 7, 2019 15:21
WordPress snippets

WP_HEAD cleanup

/*!
 * WP_HEAD cleanup
 * This removes bogus markup, stylesheets, and scripts from the `<head>`-tag in WordPress installations.
 * It also unregisters the built-in version of jQuery, so you can register your own, updated version of jQuery.
 */
function moso_cleanup() {
    remove_action('wp_head', 'feed_links_extra', 3);                      // Category feeds
    remove_action('wp_head', 'feed_links', 2);                            // Post and comment feeds
@moso
moso / app.js
Last active December 15, 2022 07:28
laravel-mix config
// jQuery import
global.jQuery = require('jquery');
var $ = global.jQuery;
window.$ = $;
// Bootstrap 4 depends on Popper.js
// Popper.js import
//import Popper from 'popper.js';
//window.Popper = Popper;

Create partition on empty drive

  • Start fdisk - change /dev/sda2 with your harddrive.
sudo fdisk /dev/sda
  • Select p to view all partitions.
  • Select n to create a new partition.
  • Type p for primary partition.
  • Enter which number partition the partition is on the harddrive. Typically 1.
### Proposed Danish/International fixes by Dane Playing FM
#Denmark
"AWARD_NAME_CHANGE" 938438 "Arla U21 Talent Pris" "Danish"
"AWARD_NAME_CHANGE" 938458 "Arla U19 Talent Pris" "Danish"
"AWARD_NAME_CHANGE" 938476 "Arla U17 Talent Pris" "Danish"
"AWARD_NAME_CHANGE" 938651 "Canal + : Månedens Mål" "Danish"
"AWARD_NAME_CHANGE" 925008 "Årets Talent" "Danish"
"AWARD_SHORT_NAME_CHANGE" 106909 "Årets Fodboldspiller" "Danish"
"AWARD_LONG_NAME_CHANGE" 106909 "Landsbankinn : Årets Danske Fodboldspiller" "Danish"
"AWARD_SHORT_NAME_CHANGE" 930999 "Årets Hold" "Danish"
### Proprosed Danish/International fixes by Dane Playing FM
#Denmark
"COMP_LONG_NAME_CHANGE" 6 "Alka Superligaen" "Danish"
"COMP_SHORT_NAME_CHANGE" 6 "Superliga" "Danish"
"COMP_LONG_NAME_CHANGE" 7 "1. Division" "Danish"
"COMP_SHORT_NAME_CHANGE" 7 "1. Division" "Danish"
"COMP_LONG_NAME_CHANGE" 1701138 "2. Division Øst" "Danish"
"COMP_SHORT_NAME_CHANGE" 1701138 "2. Division Øst" "Danish"
"COMP_LONG_NAME_CHANGE" 1701139 "2. Division Vest" "Danish"
"COMP_SHORT_NAME_CHANGE" 1701139 "2. Division Vest" "Danish"