Skip to content

Instantly share code, notes, and snippets.

View iRoachie's full-sized avatar

Kyle Roach iRoachie

View GitHub Profile
@iRoachie
iRoachie / rewrite.sh
Created March 3, 2019 22:57
Rewrite git history author
#!/bin/sh
git filter-branch --env-filter '
OLD_EMAIL="oldemail@gmail.com"
CORRECT_NAME="John Brown"
CORRECT_EMAIL="newemail@gmail.com"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
export GIT_COMMITTER_NAME="$CORRECT_NAME"
export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL"
@dphrag
dphrag / ErrorFocus.jsx
Created November 1, 2018 23:41
Formik Scroll To First Invalid Element W/O Refs
import React from 'react';
import { connect } from 'formik';
class ErrorFocus extends React.Component {
componentDidUpdate(prevProps) {
const { isSubmitting, isValidating, errors } = prevProps.formik;
const keys = Object.keys(errors);
if (keys.length > 0 && isSubmitting && !isValidating) {
const selector = `[id="${keys[0]}"]`;
const errorElement = document.querySelector(selector);
@hatpick
hatpick / react-native-material-kit.d.ts
Last active August 31, 2017 12:36
React Native Material Kit
declare module 'react-native-material-kit' {
import * as React from 'React';
import {
ViewProperties,
ViewStyle,
TextStyle,
KeyboardType,
TextInputProperties,
TouchableWithoutFeedbackProperties
} from 'react-native';
@jasperf
jasperf / launch_sublime_from_terminal.markdown
Last active April 5, 2020 05:44 — forked from artero/launch_sublime_from_terminal.markdown
Launch Sublime Text 3 from the Mac OS X Terminal

Launch Sublime Text 3 from the Mac OS X Terminal

Sublime Text 3 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/3/osx_command_line.html

Installation

@paulirish
paulirish / what-forces-layout.md
Last active June 15, 2024 19:14
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@yaronguez
yaronguez / ACF Country List
Created February 17, 2015 01:37
Country list formatted for Advanced Custom Fields select dropdown
afghanistan : Afghanistan
albania : Albania
algeria : Algeria
american_samoa : American Samoa
andorra : Andorra
angola : Angola
anguilla : Anguilla
antigua_and_barbuda : Antigua and Barbuda
argentina : Argentina
armenia : Armenia
@wh1tney
wh1tney / deploy-static-site-heroku.md
Last active June 13, 2024 16:50
How to deploy a static website to Heroku

Gist

This is a quick tutorial explaining how to get a static website hosted on Heroku.

Why do this?

Heroku hosts apps on the internet, not static websites. To get it to run your static portfolio, personal blog, etc., you need to trick Heroku into thinking your website is a PHP app. This 6-step tutorial will teach you how.

Basic Assumptions