Skip to content

Instantly share code, notes, and snippets.

View sulfo's full-sized avatar

Michael Sørensen sulfo

View GitHub Profile
@sulfo
sulfo / 0_BQ_description.md
Created March 21, 2022 08:13 — forked from OrenBochman/0_BQ_description.md
Big Query for GA analytics

BigQuery for Google Analytics

No metrics in

Self Joins

  • Cross Join example
  • Inner Join example

joins can be inefficent - they can require moving lots of data around and increase the data process from n to n * n

@sulfo
sulfo / restore-essentials.md
Created September 28, 2017 15:41 — forked from matiasvad/restore-essentials.md
Restore of Mac - Essentials

Restore of Mac - Essentials

General

  • Chrome (Extensions synced through account)
  • Dropbox
  • 1Password
  • Spotify
  • Spark

Utilities

# Set the root path (that's our variable not Nginx variable) to the landing page template file
set $rootPath "/map.php";
set $crawlerPath "/map.html";
if ($http_user_agent ~ "Ask Jeeves/Teoma|AdsBot-Google|exabot|Mediapartners-Google|GoogleToolbar|Google Web Preview|googlebot|yahoo|bingbot|baiduspider|facebookexternalhit|twitterbot|rogerbot|linkedinbot|msnbot|embedly|quora link preview|showyoubot|outbrain|pinterest|slackbot|vkShare|W3C_Validator|WebCrawler|Screaming Frog SEO Spider|Slackbot-LinkExpanding|robot|crawler") {
set $isCrawler 1;
rewrite ^ $crawlerPath;
}
if ($isCrawler = 0) {
rewrite ^ $rootPath;
@sulfo
sulfo / gist:a07cc42491e15cbaef6566db6a333451
Created July 17, 2017 12:38 — forked from bhurlow/gist:3043629
Linux Screen Cheat Sheets
–ctrl a c -> cre­ate new win­dow
–ctrl a A -> set win­dow name
–ctrl a w -> show all win­dow
–ctrl a 1|2|3|… -> switch to win­dow n
–ctrl a ” -> choose win­dow
–ctrl a ctrl a -> switch between win­dow
–ctrl a d -> detach win­dow
–ctrl a ? -> help
–ctrl a [ -> start copy, move cur­sor to the copy loca­tion, press ENTER, select the chars, press ENTER to copy the selected char­ac­ters to the buffer
–ctrl a ] -> paste from buffer
@sulfo
sulfo / functions.php
Created November 19, 2015 19:47 — forked from jukra/functions.php
WooCommerce remaining cost for free shipping notification
function cart_notice() {
$free_shipping_settings = get_option( 'woocommerce_free_shipping_settings' );
$maximum = $free_shipping_settings['min_amount'];
$current = WC()->cart->subtotal;
if ( $current < $maximum ) {
echo '<div class="woocommerce-message">Get free shipping if you order $ ' . ($maximum - $current) . ' more!</div>';
}
}
add_action( 'woocommerce_before_cart', 'cart_notice' );