Skip to content

Instantly share code, notes, and snippets.

View EnricoVogt's full-sized avatar
💭
i make computer beep boop beep beep boop

EV EnricoVogt

💭
i make computer beep boop beep beep boop
View GitHub Profile
@AlexAegis
AlexAegis / http-effect.function.ts
Last active August 21, 2020 09:22
Http effect creator for NgRX
import { Actions, ofType } from '@ngrx/effects';
import { ActionCreator } from '@ngrx/store';
import { TypedAction } from '@ngrx/store/src/models';
import { Observable, of } from 'rxjs';
import { catchError, map, switchMap } from 'rxjs/operators';
/**
* It will automatically strip the actions `type` field away before forwarding it
* to the httpCall. This way no accidental type fields are sent anywhere.
*
@cure53
cure53 / scriptlet.md
Last active August 23, 2025 07:29
The Scriptless Scriptlet - Or how to execute JavaScript from CSS in MSIE11 without using Scripts

The Scriptless Scriptlet

Or how to execute JavaScript from CSS in MSIE11 without using Scripts

Stop! This text is only interesting for you if you...

  • Like popping alerts in weird situations
  • Miss CSS expressions as much as we do
  • Have an unhealthy obsession for markup porn

Introduction

@mhintz
mhintz / simpleflux.js
Created July 20, 2015 13:20
Super Simple Flux Implementation
// The dispatcher has no dependencies. It is a simple event emitter
var dispatcher = {
listeners: [],
emit: function(name, meta) {
this.listeners.forEach(function(listener) {
listener({
name: name,
payload: meta
})
})
@jegtnes
jegtnes / sass_colorfunctions.php
Created June 6, 2013 08:43
A function attempting to rudimentary replicate SASS lighten/darken functions. Adapted from Frxstrem's answer on StackOverflow: http://stackoverflow.com/questions/3512311/how-to-generate-lighter-darker-color-with-php
<?php
function sass_darken($hex, $percent) {
preg_match('/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i', $hex, $primary_colors);
str_replace('%', '', $percent);
$color = "#";
for($i = 1; $i <= 3; $i++) {
$primary_colors[$i] = hexdec($primary_colors[$i]);
$primary_colors[$i] = round($primary_colors[$i] * (100-($percent*2))/100);
$color .= str_pad(dechex($primary_colors[$i]), 2, '0', STR_PAD_LEFT);
}