Skip to content

Instantly share code, notes, and snippets.

:octocat:
...

Michael Gerstmann webdesignberlin

:octocat:
...
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);
}
defaults();
// 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 }) {
console.log(a);
}
View animated-hamburger.scss
/**
The following mixin works when @include[ed] onto a div containing three empty spans:
<div class="animated-hamburger">
<span></span>
<span></span>
<span></span>
</div>
To get the animation on click, use the following JQuery:
@webdesignberlin
webdesignberlin / README.md
Created Jul 7, 2016 — forked from jonathantneal/README.md
Fluid Aspect: A Sass mixin for creating intrinsic ratios
View README.md

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
webdesignberlin / example.md
Created Jul 3, 2016 — forked from ericclemmons/example.md
HTML5 <details> in GitHub
View example.md

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!

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

nginx auf dem Uberspace

Installation

Lade die neueste "mainline"-Version (hier 1.7.9) von http://nginx.org/en/download.html herunter und entpacke sie:

$ wget http://nginx.org/download/nginx-1.7.9.tar.gz 
$ tar xf nginx-1.7.9.tar.gz
@webdesignberlin
webdesignberlin / get_ip.php
Created Apr 21, 2016
Get end user IP address
View get_ip.php
<?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
webdesignberlin / prefixed-office-properties.md
Created Apr 4, 2016 — forked from webtobesocial/prefixed-office-properties.md
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.
View prefixed-office-properties.md

MS Office prefixed style properties

mso-ansi-font-size

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.