Skip to content

Instantly share code, notes, and snippets.

View erikhazzard's full-sized avatar

Erik Hazzard erikhazzard

View GitHub Profile
@kiok46
kiok46 / redux_setup.md
Last active February 15, 2021 01:02
Redux, store, actions and reducers setup along with explanation.

Redux Setup

Implementation of redux inside any react.js or react-native application,

  • we will create an instance of the redux store.
  • We are going to create a provider tag from react redux library
  • Then render that provider tag passing in the store as a prop, then any child component to this provider tag will have access to this store through the context system inside of react.
  • import { Provider } from ‘react-redux’; // In main.js
  • to create a store create one in a separate folder.
@paulirish
paulirish / what-forces-layout.md
Last active April 30, 2024 17:56
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
@RoyAwesome
RoyAwesome / Downloader.cs
Last active August 29, 2015 13:55
Everquest Landmark downloader
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using REsideUtility;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
# MAC manipulators
alias random_mac='sudo ifconfig en0 ether `openssl rand -hex 6 | sed "s/\(..\)/\1:/g; s/.$//"`'
alias restore_mac='sudo ifconfig en0 ether YOUR_ORIGINAL_MAC_ADDRESS_GOES_HERE'
<!DOCTYPE html>
<html>
<head>
<title>Leaflet TopoJSON Example</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="//cdn.leafletjs.com/leaflet-0.4.5/leaflet.css" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="//cdn.leafletjs.com/leaflet-0.4.5/leaflet.js"></script>
@Nurdok
Nurdok / python_conversion.md
Last active December 16, 2022 03:45
Python Conversion

Python Number Conversion Chart

From To Expression
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active May 2, 2024 03:13
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@ZJONSSON
ZJONSSON / index.html
Created July 11, 2012 01:47 — forked from pere/index.html
testing circles in Leaflet.js (working)
<!DOCTYPE html>
<html>
<head>
<title>Testing d3.js in Leaflet.js</title>
<link rel="stylesheet" href="leaflet.css"></link>
<script src="http://mbostock.github.com/d3/d3.v2.js?2.8.1"></script>
<script src="http://code.leafletjs.com/leaflet-0.3.1/leaflet.js"></script>
<style type="text/css">
svg , g
@devinrhode2
devinrhode2 / clean-scrollbar.css
Created May 2, 2012 03:42
Like, basically PERFECT scrollbars
/**
* Like, basically PERFECT scrollbars
*/
/*
It's pure CSS.
Since a quick google search will confirm people going crazy about Mac OS Lion scrollbars...
this has no fade-out effect.
In Mac OS Lion, the lowest common denominator is always showing scrollbars by a setting.
@bdotdub
bdotdub / redis.markdown
Created November 24, 2010 22:18
Running redis using upstart on Ubuntu

Running redis using upstart on Ubuntu

I've been trying to understand how to setup systems from the ground up on Ubuntu. I just installed redis onto the box and here's how I did it and some things to look out for.

To install: