Skip to content

Instantly share code, notes, and snippets.

Peter Hudec peterhudec

View GitHub Profile
View deepMerge.js
var R = require('ramda')
var one = {
test: {
a: 1,
b: 2
pemento: "sipi",
arr: ['a', 'b']
paulirish /
Last active Jul 9, 2020
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
View Authomatic and Flask-Login
@app.route('/login/<provider_name>', methods=['GET', 'POST'])
def login(provider_name):
if g.user is not None and g.user.is_authenticated():
return redirect(url_for('index'))
if authomatic.result:
if authomatic.result.error:
return 'Something went wrong: {0}'.format(authomatic.result.error.message)
if authomatic.result.user:
staltz /
Last active Jul 9, 2020
The introduction to Reactive Programming you've been missing
alonho /
Created Dec 27, 2012
Flask: drop into pdb on exception
def drop_into_pdb(app, exception):
import sys
import pdb
import traceback
# somewhere in your code (probably if DEBUG is True)
datagrok / gist:2199506
Last active Jan 7, 2020
Virtualenv's `bin/activate` is Doing It Wrong
View gist:2199506
lucasfais / gist:1207002
Created Sep 9, 2011
Sublime Text 2 - Useful Shortcuts
View gist:1207002

Sublime Text 2 – Useful Shortcuts (Mac OS X)


⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
clintel / gist:1155906
Created Aug 19, 2011
Fenced code in bullet lists with GitHub-flavoured MarkDown??
View gist:1155906

Fenced code blocks inside ordered and unordered lists

  1. This is a numbered list.

  2. I'm going to include a fenced code block as part of this bullet:

    More Code
brantfaircloth /
Created Jan 23, 2011
Sphinx documentation to github gh-pages without submodules
# assume the following directory structure where contents of doc/
# and source/ are already checked into repo., with the exception
# of the _build directory (i,e. you can check in _themes or _sources
# or whatever else).
# proj/
# source/
# doc/
# remove doc/_build/html if present
You can’t perform that action at this time.