Skip to content

Instantly share code, notes, and snippets.

Niklas npostulart

  • u+i interact
  • Germany
Block or report user

Report or block npostulart

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
npostulart /
Created Jul 17, 2019 — forked from jed/
How to set up stress-free SSL on an OS X development machine

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

npostulart / TwoPointHeading.php
Created Nov 18, 2018
Get heading from two lat/lng points
View TwoPointHeading.php
function computeHeading($from, $to) {
$fromLat = deg2rad($from['lat']);
$fromLng = deg2rad($from['lng']);
$toLat = deg2rad($to['lat']);
$toLng = deg2rad($to['lng']);
$dLng = $toLng - $fromLng;
$heading = rad2deg(
npostulart /
Last active Aug 19, 2018
Simple Feature Detection Library

Simple Feature Detection Library to check JS, SVG and Touch support. Replaces no-js class on html element with js, adds no-svg if no support for SVG and touch or no-touch depending on the used device.

npostulart / convert-function.scss
Last active Mar 14, 2019
Unit Converting Sass Function
View convert-function.scss
// ----
// Sass (v3.4.12)
// Compass (v1.0.3)
// ----
$baseSize: 16px;
$convertBase: $baseSize;
html {
font-size: percentage($baseSize / 16px);
npostulart / rem-attributes.scss
Last active Nov 7, 2017
REM Mixin for CSS Attributes
View rem-attributes.scss
// ----
// Sass (v3.3.14)
// ----
@function parseInt($n) {
@return $n / ($n * 0 + 1);
@mixin rem($property, $values) {
$px : ();
npostulart / simple_breakpoint.scss
Last active Nov 7, 2017
Simple Breakpoints Mixin
View simple_breakpoint.scss
/// Simple Breakpoint Mixin
/// Takes list of arguments to define media queries
/// @author Niklas Postulart
/// @group layout
/// @param {Lists} $lists - Lists of queries
/// @example
/// .example {
/// @include breakpoint(min 100px, max 30rem) {
You can’t perform that action at this time.