Skip to content

Instantly share code, notes, and snippets.

@felixyz
felixyz / Intro to Common Table Expressions.md
Last active December 22, 2023 12:23
Introduction to transitive closure / Common Table Expressions / iterative queries in SQL

Teh Social Netswork!

CREATE TABLE users (
 id SERIAL PRIMARY KEY,
 name VARCHAR(10) NOT NULL
);

INSERT into users VALUES

@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
@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

@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

@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
@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>
@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="*" />
@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:

@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