Skip to content

Instantly share code, notes, and snippets.

👮‍♀
git inspector

Andrew Luca iamandrewluca

👮‍♀
git inspector
Block or report user

Report or block iamandrewluca

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
@calebporzio
calebporzio / pure_html_css_modal.css
Last active Sep 12, 2019
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 Feb 28, 2019
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 Aug 7, 2019
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 Aug 1, 2019
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 Apr 6, 2019
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 Sep 27, 2018
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 {
@Jakobud
Jakobud / _linear-interpolation.scss
Last active Oct 23, 2018
Linear Interpolation SASS function
View _linear-interpolation.scss
/// linear-interpolation
/// Calculate the definition of a line between two points
/// @param $map - A SASS map of viewport widths and size value pairs
/// @returns A linear equation as a calc() function
/// @example
/// font-size: linear-interpolation((320px: 18px, 768px: 26px));
/// @author Jake Wilson <jake.e.wilson@gmail.com>
@function linear-interpolation($map) {
$keys: map-keys($map);
@if (length($keys) != 2) {
You can’t perform that action at this time.