Skip to content

Instantly share code, notes, and snippets.

👮‍♂️
git inspector

Andrew Luca iamandrewluca

👮‍♂️
git inspector
View GitHub Profile
@erikras
erikras / 00-ReduxFormDocsDeploy.md
Last active Oct 14, 2019
Redux Form Docs Deploy
View 00-ReduxFormDocsDeploy.md

Directory structure

@calebporzio
calebporzio / pure_html_css_modal.css
Last active May 22, 2020
The CSS for the pure HTML/CSS modal I tweeted about.
View pure_html_css_modal.css
details summary {
cursor: pointer;
outline: none !important;
display: inline-block;
padding: 8px 12px;
padding-top: 10px;
border-radius: 4px;
overflow: hidden;
background: #F09825;
color: white;
@cmrigney
cmrigney / useRedux.ts
Created Apr 11, 2019
Example for useRedux
View useRedux.ts
// Adapted code from https://github.com/flepretre/use-redux
import { useContext, useState, useEffect, useCallback } from 'react';
import { ReactReduxContext } from 'react-redux';
import { bindActionCreators, ActionCreator } from 'redux';
export function useRedux() {
const { store } = useContext(ReactReduxContext);
const { getState, dispatch, subscribe } = store;
const reduxState = getState();
@kitze
kitze / missing-date-fns.js
Last active Jun 21, 2020
good ol' date-fns
View missing-date-fns.js
import {
formatDistance,
isAfter,
isBefore,
endOfDay,
startOfDay,
isSameDay,
isSameSecond,
isSameMinute,
isSameHour,
@shane-axiom
shane-axiom / nginx_google_analytics
Last active Jul 4, 2020
google analytics in nginx
View nginx_google_analytics
# send logs for all traffic (including non-html) to google analytics
#
# in server block:
# set $google_analytics_id "UA-THECORRECT-ID";
# include /srv/nginx/google_analytics;
#
# in location blocks:
# post_action @ga;
#
# notes: post_action has been referred to by nginx devs as a "dirty hack" and this approach may stop working one day.
View api-cheatsheet-array.md

Array<T>

Legend:

  • ✏️ method changes this.
  • 🔒 method does not change this.

Array<T>.prototype.*:

  • concat(...items: Array<T[] | T>): T[] 🔒 ES3
@helhum
helhum / composer.json
Last active Feb 13, 2020
The (currently) ideal TYPO3 composer setup
View composer.json
{
"require": {
"typo3-console/composer-auto-setup": "^0.1",
"georgringer/news": "^6.1",
"helhum/typo3-secure-web": "^0.2.5",
"typo3/cms-introduction": "^3.0"
},
"extra": {
"typo3/cms": {
"cms-package-dir": "{$vendor-dir}/typo3/cms",
@Jakobud
Jakobud / _map-sort.scss
Last active May 29, 2020
Sort a SASS map
View _map-sort.scss
/// map-sort
/// Sort map by keys
/// @param $map - A SASS map
/// @returns A SASS map sorted by keys
/// @requires function list-sort
/// @author Jake Wilson <jake.e.wilson@gmail.com>
@function map-sort($map) {
$keys: list-sort(map-keys($map));
$sortedMap: ();
@each $key in $keys {
@Jakobud
Jakobud / _list-sort.scss
Last active Mar 13, 2020
Sort a SASS list
View _list-sort.scss
/// list-sort
/// Sort a SASS list
/// @param $list - A SASS list
/// @returns A sorted SASS list
/// @requires function list-remove
/// @author Jake Wilson <jake.e.wilson@gmail.com>
@function list-sort($list) {
$sortedlist: ();
@while length($list) > 0 {
$value: nth($list,1);
@Jakobud
Jakobud / _list-remove.scss
Created Apr 25, 2017
Removed an item for a SASS list based on it's index (mimics behavior of the native map-remove function)
View _list-remove.scss
/// list-remove
/// Remove an item from a list
/// @param $list - A SASS list
/// @param $index - The list index to remove
/// @returns A SASS list
/// @author Jake Wilson <jake.e.wilson@gmail.com>
@function list-remove($list, $index) {
$newList: ();
@for $i from 1 through length($list) {
@if $i != $index {
You can’t perform that action at this time.