Skip to content

Instantly share code, notes, and snippets.

View lorenries's full-sized avatar

Loren Riesenfeld lorenries

View GitHub Profile
@mshafrir
mshafrir / states_hash.json
Created May 9, 2012 17:05
US states in JSON form
{
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",
@staltz
staltz / introrx.md
Last active July 25, 2024 13:33
The introduction to Reactive Programming you've been missing
@paulirish
paulirish / what-forces-layout.md
Last active July 25, 2024 07:49
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
@Chandler
Chandler / slack_history.py
Last active July 18, 2024 04:21
Download Slack Channel/PrivateChannel/DirectMessage History
print("UPDATE AUG 2023: this script is beyond old and broken")
print("You may find interesting and more up to date resources in the comments of the gist")
exit()
from slacker import Slacker
import json
import argparse
import os
# This script finds all channels, private channels and direct messages
@lmarkus
lmarkus / README.MD
Last active July 19, 2024 17:41
Extracting / Exporting custom emoji from Slack

Extracting Emoji From Slack!

Slack doesn't provide an easy way to extract custom emoji from a team. (Especially teams with thousands of custom emoji) This Gist walks you through a relatively simple approach to get your emoji out.

If you're an admin of your own team, you can get the list of emoji directly using this API: https://api.slack.com/methods/emoji.list. Once you have it, skip to Step 3

HOWEVER! This gist is intended for people who don't have admin access, nor access tokens for using that list.

Follow along...

@coredumperror
coredumperror / responsive_image.py
Last active October 17, 2023 15:59 — forked from davecranwell/responsive_image.py
Responsive image tag for Wagtail CMS
from django import template
from wagtail.wagtailimages.models import SourceImageIOError
from wagtail.wagtailimages.templatetags.wagtailimages_tags import ImageNode
register = template.Library()
@register.tag(name="responsiveimage")
def responsiveimage(parser, token):
bits = token.split_contents()[1:]
@asielen
asielen / data.csv
Last active March 1, 2023 09:59
Violin Plot + Box Plot v3
date value
2000 208.4968974
2000 160.5328879
2002 292.3321976
1998 95.07969441
2001 251.6346499
1996 4.723143097
1997 221.3608926
2002 257.5135771
1999 256.6401961
@minniel
minniel / slack_history.py
Last active February 28, 2022 22:02 — forked from Chandler/slack_history.py
Download Slack Channel/PrivateChannel/DirectMessage History
from slacker import Slacker
import json
import argparse
import os
import shutil
import copy
from datetime import datetime
# This script finds all channels, private channels and direct messages
# that your user participates in, downloads the complete history for
<?
/////////////////////
// slack2html
// by @levelsio
/////////////////////
//
/////////////////////
// WHAT DOES THIS DO?
/////////////////////
//
@DavidKuennen
DavidKuennen / minimal-analytics-snippet.js
Last active June 9, 2024 19:08
Minimal Analytics Snippet
(function (context, trackingId, options) {
const history = context.history;
const doc = document;
const nav = navigator || {};
const storage = localStorage;
const encode = encodeURIComponent;
const pushState = history.pushState;
const typeException = 'exception';
const generateId = () => Math.random().toString(36);
const getId = () => {