Skip to content

Instantly share code, notes, and snippets.

View afparsons's full-sized avatar
🏠
Working from home

Andrew Parsons afparsons

🏠
Working from home
  • Boston, Massachusetts
  • 08:40 (UTC -05:00)
View GitHub Profile
@dmur
dmur / MIT LICENSE
Created July 19, 2012 21:46
Attractively wrapped 80-col MIT license
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
@dstar4138
dstar4138 / xorg.conf.docked
Created January 24, 2013 04:57
My Xorg.conf scripts for when my laptop is docked/undocked and my graphics card is on/off.
Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0" 0 0
Screen 1 "Screen1" RightOf "Screen0"
Screen 2 "Screen2" RightOf "Screen1"
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
Option "Xinerama" "1"
EndSection
@daemox
daemox / 10-monitor.conf
Created August 23, 2013 23:45
/etc/X11/xorg.conf.d/10-monitor.conf for Dual monitor NVIDIA driver setup. Screen1 is rotated and above screen0.
# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings: version 325.15 (buildmeister@swio-display-x64-rhel04-03) Wed Jul 31 19:04:13 PDT 2013
Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0" 0 1280
Screen 1 "Screen1" 448 0
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
Option "Xinerama" "0"
@alanhamlett
alanhamlett / api.py
Last active October 21, 2024 14:30
Serialize SQLAlchemy Model to dictionary (for JSON output) and update Model from dictionary attributes.
import uuid
import wtforms_json
from sqlalchemy import not_
from sqlalchemy.dialects.postgresql import UUID
from wtforms import Form
from wtforms.fields import FormField, FieldList
from wtforms.validators import Length
from flask import current_app as app
from flask import request, json, jsonify, abort
@soheilhy
soheilhy / nginxproxy.md
Last active July 5, 2025 15:29
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@ul
ul / Заряница.md
Last active December 10, 2022 03:11
Заряница. Язык просветов

Заряница. Язык просветов

Теория символизма является частью Узоров Актики и рассматривается в разделе Просветов, познакомиться с которым можно в этой презентации:

Узоры Актики. Просветы

Вместе с изложением теории символизма в этом разделе создаётся особенный язык просветов — символический язык.

«Заряница» — это визуальный символический язык, созданный на основе матрицы традиционного белорусского народного орнамента.

@rafszul
rafszul / neo4j and graphs links.md
Created August 13, 2014 11:36
neo4j and graphs links
@norcal82
norcal82 / state_names.py
Last active June 17, 2025 15:46
python array of US state names
state_names=["Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado", "Connecticut", "Delaware", "Florida", "Georgia", "Hawaii", "Idaho", "Illinois", "Indiana", "Iowa", "Kansas", "Kentucky", "Louisiana", "Maine", "Maryland", "Massachusetts", "Michigan", "Minnesota", "Mississippi", "Missouri", "Montana", "Nebraska", "Nevada", "New Hampshire", "New Jersey", "New Mexico", "New York", "North Carolina", "North Dakota", "Ohio", "Oklahoma", "Oregon", "Pennsylvania", "Rhode Island", "South Carolina", "South Dakota", "Tennessee", "Texas", "Utah", "Vermont", "Virginia", "Washington", "West Virginia", "Wisconsin", "Wyoming"]
@Zearin
Zearin / python_decorator_guide.md
Last active November 6, 2025 16:16
The best explanation of Python decorators I’ve ever seen. (An archived answer from StackOverflow.)

NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.


Q: How can I make a chain of function decorators in Python?


If you are not into long explanations, see [Paolo Bergantino’s answer][2].

@adam-p
adam-p / README.md
Created October 1, 2014 13:50
Patching Python code at runtime

A rather dirty way to patch module code at runtime.