Skip to content

Instantly share code, notes, and snippets.

@jedwards1211
jedwards1211 / useConnection.js
Last active June 3, 2020 12:00
useConnection (a React hook for infinite scrolling with Apollo, Relay-style Connections, and react-virtualized)
/**
* @flow
* @prettier
*/
import { type QueryRenderProps } from 'react-apollo'
import * as React from 'react'
import {
get,
takeRightWhile,
@josephan
josephan / setup_tailwind_in_phoenix.md
Last active August 8, 2023 05:50
Add Tailwind CSS to an Elixir/Phoenix Project with PurgeCSS
@atomiks
atomiks / fix-blinkmacsystemfont-kerning.js
Last active May 18, 2020 14:54
Fixes BlinkMacSystemFont / -apple-system (San Francisco) letter tracking/kerning on macOS for affected browsers
/*
* A small utility to fix the letter kerning on macOS Chrome and Firefox when using the system font
* (San Francisco). It is now fixed in the text rendering engine in FF 58 and Chrome 64.
* UPDATE: It appears the applied fix doesn't work when the font is in italics. New fix has been added.
* Must be applied to all browsers for now.
*/
;(() => {
const ua = navigator.userAgent
// macOS 10.11 (El Capitan) came with San Francisco. Previous versions used Helvetica
@soulmachine
soulmachine / jwt-expiration.md
Last active June 21, 2024 14:09
How to deal with JWT expiration?

First of all, please note that token expiration and revoking are two different things.

  1. Expiration only happens for web apps, not for native mobile apps, because native apps never expire.
  2. Revoking only happens when (1) uses click the logout button on the website or native Apps;(2) users reset their passwords; (3) users revoke their tokens explicitly in the administration panel.

1. How to hadle JWT expiration

A JWT token that never expires is dangerous if the token is stolen then someone can always access the user's data.

Quoted from JWT RFC:

@jsonmaur
jsonmaur / bzexcluderules_editable.xml
Last active April 9, 2024 04:47
Backblaze Custom Exclude
<excludefname_rule plat="mac" osVers="*" ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/.git/" contains_2="*" doesNotContain="*" endsWith="*" hasFileExtension="*" />
<excludefname_rule plat="mac" osVers="*" ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/node_modules/" contains_2="*" doesNotContain="*" endsWith="*" hasFileExtension="*" />
<excludefname_rule plat="mac" osVers="*" ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/_build/" contains_2="*" doesNotContain="*" endsWith="*" hasFileExtension="*" />
<excludefname_rule plat="mac" osVers="*" ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/deps/" contains_2="*" doesNotContain="*" endsWith="*" hasFileExtension="*" />
@antishok
antishok / auth-popup-callback.html
Last active May 20, 2023 09:23
passport popup login
<!doctype html>
<html>
<head><title>Log-In</title></head>
<script>
if (window.opener) {
window.opener.postMessage("popup-done", "*");
setTimeout(function() { window.close() }, 0);
}
</script>
</head>
@ErisDS
ErisDS / categories.txt
Created September 27, 2016 15:28
New marketplace categories
Personal Blogs
Magazine Layouts
News Sites
Business Blogs
Minimal
Photography Corner
Video Heavy
Artistic
Social Hubs
Grid Based
@gbaman
gbaman / HowToOTGFast.md
Last active May 14, 2024 10:26
Simple guide for setting up OTG modes on the Raspberry Pi Zero, the fast way!

Setting up Pi Zero OTG - The quick way (No USB keyboard, mouse, HDMI monitor needed)

More details - http://blog.gbaman.info/?p=791

For this method, alongside your Pi Zero, MicroUSB cable and MicroSD card, only an additional computer is required, which can be running Windows (with Bonjour, iTunes or Quicktime installed), Mac OS or Linux (with Avahi Daemon installed, for example Ubuntu has it built in).
1. Flash Raspbian Jessie full or Raspbian Jessie Lite onto the SD card.
2. Once Raspbian is flashed, open up the boot partition (in Windows Explorer, Finder etc) and add to the bottom of the config.txt file dtoverlay=dwc2 on a new line, then save the file.
3. If using a recent release of Jessie (Dec 2016 onwards), then create a new file simply called ssh in the SD card as well. By default SSH i

@manigandham
manigandham / rich-text-html-editors.md
Last active June 10, 2024 15:49
Rich text / HTML editors and frameworks

Strictly Frameworks

Abstracted Editors

These use separate document structures instead of HTML, some are more modular libraries than full editors

@bufke
bufke / Dockerfile
Created October 1, 2015 21:23
GeoDjango with docker-compose
FROM python:3.4
ENV PYTHONUNBUFFERED 1
RUN apt-get update ; apt-get --assume-yes install binutils libproj-dev gdal-bin
RUN wget http://download.osgeo.org/geos/geos-3.4.2.tar.bz2
RUN tar -xjf geos-3.4.2.tar.bz2
RUN cd geos-3.4.2; ./configure; make; make install
RUN wget http://download.osgeo.org/gdal/1.11.0/gdal-1.11.0.tar.gz
RUN tar -xzf gdal-1.11.0.tar.gz