Skip to content

Instantly share code, notes, and snippets.


Michael Gerstmann webdesignberlin

Block or report user

Report or block webdesignberlin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View simple-destructuring-default-params.js
function defaults({ a, b } = { a: 1, b: 2 }) {
console.log('a', a);
console.log('b', b);
// a 1
// b 2
defaults({ a: 42, b: 32 });
View destructuring-rename.js
// simple renaming to avoid collisions or just as a preference.
const a = 5;
const { a: b } = { a: 3 };
console.log(b); // prints 3
// rename for another API and use enhanced object literal notation.
function verifyUser({ userId: id }) {
return User.update({ id, verified: true });
View simple-es6.js
// can destructure arrays
const [a, b] = [1,2]; // a = 1, b = 2
// can destructure object keys
const { a } = { a: 3 }; // a = 3
// even function parameters
function foo({ a }) {
View animated-hamburger.scss
The following mixin works when @include[ed] onto a div containing three empty spans:
<div class="animated-hamburger">
To get the animation on click, use the following JQuery:
webdesignberlin /
Created Jul 7, 2016 — forked from jonathantneal/
Fluid Aspect: A Sass mixin for creating intrinsic ratios

Fluid Aspect

fluid-aspect is a Sass mixin for creating intrinsic ratios in CSS. Intrinsic ratios allow elements to fill the width of their containing block and resize on the fly while maintaining their aspect ratio.

@include fluid-aspect($ratio, [$target]);
  • $ratio: An aspect ratio represented as two numbers separated by a space. Defaults to 1:1
  • $target: A selector targeting the element to be made fluid. Defaults to "> :first-child"
webdesignberlin /
Created Jul 3, 2016 — forked from ericclemmons/
HTML5 <details> in GitHub

Using <details> in GitHub

Suppose you're opening an issue and there's a lot noisey logs that may be useful.

Rather than wrecking readability, wrap it in a <details> tag!

 <summary>Summary Goes Here</summary>
View vanilla-lazy-load.html
.item {width:300px; display: inline-block; }
.item .itemtitle {font-weight:bold; font-size:2em;}
.hidden {display:none;}
<h1>Amalgam Comics Characters</h1>

nginx auf dem Uberspace


Lade die neueste "mainline"-Version (hier 1.7.9) von herunter und entpacke sie:

$ wget 
$ tar xf nginx-1.7.9.tar.gz
webdesignberlin / get_ip.php
Created Apr 21, 2016
Get end user IP address
View get_ip.php
function get_ip() {
//Just get the headers if we can or else use the SERVER global
if ( function_exists( 'apache_request_headers' ) ) {
$headers = apache_request_headers();
} else {
webdesignberlin /
Created Apr 4, 2016 — forked from webtobesocial/
MS Office prefixed style properties can be used for older versions of MS Excel, MS PowerPoint or MS Word when you want to save a document, presentation, workbook, or worksheet as a web document, or even in older versions for MS Outlook.

MS Office prefixed style properties


Note: Office only

mso-ansi-font-size: large | larger | <length> | medium | <percentage> | small | smaller | x-large | x-small | xx-large | xx-small
You can’t perform that action at this time.