Skip to content

Instantly share code, notes, and snippets.

@mszkb
mszkb / index.html
Last active October 25, 2018 11:16
Marching ants
<!-- Learn about this code on MDN: https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineDashOffset -->
<canvas id="canvas" class="playable-canvas"></canvas>

When you modify a file in your repository, the change is initially unstaged. In order to commit it, you must stage it—that is, add it to the index—using git add. When you make a commit, the changes that are committed are those that have been added to the index.

git reset changes, at minimum, where your current branch is pointing. The difference between --mixed and --soft is whether or not your index is also modified. So, if we're on branch master with this series of commits:

- A - B - C (master)

HEADpoints to C and the index matches C.

--soft

@mszkb
mszkb / install-docker.sh
Created August 2, 2018 04:55 — forked from dweldon/install-docker.sh
Install docker CE on Linux Mint 18.3
#!/usr/bin/env bash
# https://docs.docker.com/install/linux/docker-ce/ubuntu/
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable"
sudo apt-get update
sudo apt-get install docker-ce
# https://docs.docker.com/compose/install/
@mszkb
mszkb / attribute - Alkohol - Woocommerce
Created March 27, 2017 13:46
WooCommerce - get specific Attribut
add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_alk', 4 );
function woocommerce_template_single_alk() {
global $product;
$alk = $alk_s = $alk_temp = $alk_original = "";
$alk = get_the_terms( $product->id, 'pa_alkoholgehalt'); // Get Attribute from Produkt
if($alk == NULL) {
_e('Kein Alkoholgehalt angegeben', 'GUID-Theme');
return;
}
<?php
/*
Extends Visual Composer
More information can be found here: http://kb.wpbakery.com/index.php?title=Category:Visual_Composer
*/
// don't load directly
@mszkb
mszkb / gist:89b6978327e5315c11ec6ad9f5ee82ba
Last active January 31, 2017 10:17 — forked from blainerobison/gist:fecf1bba78527712fd6e
Wordpress Metadata - Update Metadata after Upload
/**
* Add attachment metadata
*
* By default, WordPress only adds '_wp_attachment_metadata' metadata to images, audio and video files.
* This hooks into 'wp_update_attachment_metadata' and sets 'file' to the value of '_wp_attached_file'.
*/
function prefix_update_attachment_metadata( $data, $post_id ) {
// only set 'file' if needed
if ( isset( $data['file'] ) ) {