Skip to content

Instantly share code, notes, and snippets.

View patrick91's full-sized avatar

Patrick Arminio patrick91

View GitHub Profile
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@bjoernQ
bjoernQ / AndroidManifest.xml
Created October 14, 2013 13:02
Creating a System Overlay (Always on Top over all Apps) in Android
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.mobilej.overlay"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="14" />
<application android:label="SystemOverlay" >
<activity
@fffabs
fffabs / Preferences.sublime-text.json
Created December 20, 2013 17:26
SublimeText 3 User Preferences
{
//
// Fonts
"font_face": "Monaco",
"font_options":"subpixel_antialias",
"font_size": 11.0,
"bold_folder_labels":true,
"line_padding_bottom":1,
"line_padding_top":1,
"word_separators": "./\\()\"'-:,.;<>~!@$%^&*|+=[]{}`~?", // Remove '#'
@paulirish
paulirish / what-forces-layout.md
Last active July 17, 2024 00:51
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
@manelclos
manelclos / s3signurl.py
Last active February 9, 2018 19:23 — forked from obeattie/s3signurl.py
Quick, dirty Python script that spits out a signed url for Amazon S3
#!/usr/bin/env python
import optparse
import sys
import os
os.environ['S3_USE_SIGV4'] = 'True'
from boto.s3.connection import S3Connection
def sign(bucket, path, access_key, secret_key, https, expiry, host=None):
@appeltel
appeltel / pubsub.py
Last active July 13, 2024 17:35
asyncio pubsub example
import asyncio
import random
class Hub():
def __init__(self):
self.subscriptions = set()
def publish(self, message):
@kitten
kitten / reactiveconf-sc-cfp.md
Last active November 17, 2020 15:06
ReactiveConf 2017 Lightning Talk CFP: With styled-components into the future

styled-components Logo

With styled-components into the future

Preprocessing is dead, long live preprocessing!


This is a CFP for ReactiveConf 2017's open call for Lightning talks. If you'd like to see this talk become a reality, please ⭐ star this gist. #ReactiveConf

@omaraboumrad
omaraboumrad / splitlogs.py
Created October 6, 2017 14:18
View docker-compose services logs in split tmux panes
# Requires pyyaml
import os
import yaml
run = os.system
new_window = lambda cmd: run('tmux new-window -n "logs" "{}"'.format(cmd))
split_vertical = lambda cmd: run('tmux split-window "{}"'.format(cmd))
split_horizontal = lambda cmd: run('tmux split-window -h "{}"'.format(cmd))
even_vertical = lambda: run('tmux select-layout even-vertical')
@alexcasalboni
alexcasalboni / aws-lambda-static-type-checker.md
Last active May 22, 2023 07:31
AWS Lambda Static Type Checker Example (Python3)

How to use Python3 Type Hints in AWS Lambda

TL;DR

Static Type Checkers help you find simple (but subtle) bugs in your Python code. Check out lambda_types.py and incrementally improve your code base and development/debugging experience with type hints.

Your Lambda Function code will go from this: