Skip to content

Instantly share code, notes, and snippets.

View KempfCreative's full-sized avatar
🌭
I am a meat popsicle

Jonathan Kempf KempfCreative

🌭
I am a meat popsicle
View GitHub Profile
@alexandrebodin
alexandrebodin / index.js
Created June 6, 2019 13:55
Uploading images to strapi with react and axios
import React, { Component } from 'react';
import axios from 'axios';
import './App.css';
class App extends Component {
constructor() {
super();
this.state = {
images: [],
@JNaftali
JNaftali / logicalFunctions.js
Created January 18, 2018 04:53
logical operators intended for use in gpu.js
function not(x) {
if (x) return false
return true
}
function and() {
for (var i = 0; i< arguments.length; i++) {
if ( not(arguments[i]) ) return false
}
return true
@joepie91
joepie91 / 1.md
Last active June 25, 2023 09:03
Errors 'bubbling up the chain' with Promises, and catching specific kinds of errors (with Bluebird)

Promise.try is explained here.

@paulirish
paulirish / what-forces-layout.md
Last active June 19, 2024 15:52
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
@patik
patik / how-to-squash-commits-in-git.md
Last active May 30, 2024 07:59
How to squash commits in git

Squashing Git Commits

The easy and flexible way

This method avoids merge conflicts if you have periodically pulled master into your branch. It also gives you the opportunity to squash into more than 1 commit, or to re-arrange your code into completely different commits (e.g. if you ended up working on three different features but the commits were not consecutive).

Note: You cannot use this method if you intend to open a pull request to merge your feature branch. This method requires committing directly to master.

Switch to the master branch and make sure you are up to date:

@matthewmueller
matthewmueller / osx-for-hackers.sh
Last active April 21, 2024 03:30
OSX for Hackers (Mavericks/Yosemite)
# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront