Skip to content

Instantly share code, notes, and snippets.

Steven Loria sloria

Block or report user

Report or block sloria

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View minimal-analytics-snippet.js
(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 = () => {
View minimaldjango.py
import sys
from django.conf import settings
settings.configure(
DEBUG=True,
SECRET_KEY='thisisthesecretkey',
ROOT_URLCONF=__name__,
MIDDLEWARE_CLASSES=(
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
@collinbarrett
collinbarrett / userChrome.css
Last active Nov 4, 2019
A userChrome.css to use with Tree Style Tab (https://github.com/piroor/treestyletab) for Firefox
View userChrome.css
/*
Windows
Location: C:\Users\<YourUsername>\AppData\Roaming\Mozilla\Firefox\Profiles\<YourFirefoxProfile>\chrome
Notes:
If minimize, maximize, and close buttons are no longer visible, enable the Title Bar or Menu Bar in Firefox Customize.
macOS
Location: /Users/<YourUsername>/Library/Application Support/Firefox/Profiles/<YourFirefoxProfile>/chrome
Notes:
If minimize, maximize, and close buttons overlap other controls, add the Flexible Space in Firefox Customize.
@rkrzr
rkrzr / auto_tags.py
Last active Dec 6, 2019
Automatically generate ansible tags of the same name for each role in a playbook
View auto_tags.py
"""
This module implements an Ansible plugin that is triggered at the start of a playbook.
The plugin dynamically generates a tag for each role. Each tag has the same name as its role.
The advantage of this is that it saves you some boilerplate, because you don't have to wrap
all tasks of a role in an additional block and assign a tag to that.
Additionally, it works automatically when you add new roles to your playbook.
Usage is exactly the same as without this plugin:
@duivvv
duivvv / react_fiber.md
Last active Nov 11, 2019
What is React Fiber? And how can I try it out today?
View react_fiber.md
@staltz
staltz / music.md
Last active Aug 16, 2019
coding music
View music.md

Not for everyone. Each programmer has their own appreciation of what is good coding music.

For when I need to think deep, debug something, or design

(From most influential to least)

@QinMing
QinMing / .zshrc
Last active Nov 28, 2019
.zshrc (lazy loading shell functions)
View .zshrc
# Copyright (c) 2016-2018 Ming Qin (覃明) <https://github.com/QinMing>
# Open source under MIT LICENSE.
ZSH_THEME="agnoster"
plugins=(zsh-autosuggestions git pip django docker docker-compose)
# ......
unsetopt AUTO_CD
anonymous
anonymous / dontforget.sh
Created Aug 5, 2016
Quick reminders from Terminal (bash) - Linux version
View dontforget.sh
#!/usr/bin/env bash
# dontforget
# Description: A stupid script for short term reminders in bash
# Requires: espeak, mpg123, notify-send, ogg123 (vorbis-tools)
# Source: http://brettterpstra.com/2016/01/22/quick-reminders-from-terminal
# Usage:
#
# Arguments just need to contain a number and a bunch of words.
#
# The number can be anywhere in the arguments, but there shouldn't
View pypi.md

Most downloaded projects

SELECT
  file.project,
  COUNT(*) as total_downloads,
FROM
  TABLE_DATE_RANGE(
    [the-psf:pypi.downloads],
    TIMESTAMP("20160114"),
View redux_egghead_notes.md

###Redux Egghead Video Notes###

####Introduction:#### Managing state in an application is critical, and is often done haphazardly. Redux provides a state container for JavaScript applications that will help your applications behave consistently.

Redux is an evolution of the ideas presented by Facebook's Flux, avoiding the complexity found in Flux by looking to how applications are built with the Elm language.

####1st principle of Redux:#### Everything that changes in your application including the data and ui options is contained in a single object called the state tree

You can’t perform that action at this time.