Skip to content

Instantly share code, notes, and snippets.

@klement97
klement97 / error.handler.ts
Last active June 26, 2023 12:16
A central solution to error handling in Angular Reactive Forms
import {AbstractControl, FormArray, FormControl, FormGroup, ValidationErrors} from '@angular/forms';
import {Injectable} from '@angular/core';
import {debounceTime, distinctUntilChanged} from 'rxjs/operators';
export declare interface ServerError {
[key: string]: [];
}
@bmaupin
bmaupin / free-database-hosting.md
Last active November 16, 2024 22:43
Free database hosting
@kitze
kitze / conditionalwrap.js
Created October 25, 2017 16:54
one-line React component for conditionally wrapping children
import React from 'react';
const ConditionalWrap = ({condition, wrap, children}) => condition ? wrap(children) : children;
const Header = ({shouldLinkToHome}) => (
<div>
<ConditionalWrap
condition={shouldLinkToHome}
wrap={children => <a href="/">{children}</a>}
>
@Bhavdip
Bhavdip / sketch-never-ending.md
Created October 6, 2016 15:53
Modify Sketch to never ending trial

###Sketch trial non stop

Open hosts files:

$ open /private/etc/hosts

Edit the file adding:

127.0.0.1 backend.bohemiancoding.com

127.0.0.1 bohemiancoding.sketch.analytics.s3-website-us-east-1.amazonaws.com

@lopspower
lopspower / README.md
Last active November 18, 2024 15:02
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@KittyGiraudel
KittyGiraudel / SassMeister-input.scss
Created June 6, 2015 13:48
Generated by SassMeister.com.
// ----
// Sass (v3.4.13)
// Compass (v1.0.3)
// ----
////
/// String to number converter
/// @author Hugo Giraudel
/// @access private
////