Skip to content

Instantly share code, notes, and snippets.

View hayd's full-sized avatar
😎
chillin'

Andy Hayden hayd

😎
chillin'
View GitHub Profile
@mislav
mislav / pagination.md
Created October 12, 2010 17:20
"Pagination 101" by Faruk Ateş

Pagination 101

Article by Faruk Ateş, [originally on KuraFire.net][original] which is currently down

One of the most commonly overlooked and under-refined elements of a website is its pagination controls. In many cases, these are treated as an afterthought. I rarely come across a website that has decent pagination, and it always makes me wonder why so few manage to get it right. After all, I'd say that pagination is pretty easy to get right. Alas, that doesn't seem the case, so after encouragement from Chris Messina on Flickr I decided to write my Pagination 101, hopefully it'll give you some clues as to what makes good pagination.

Before going into analyzing good and bad pagination, I want to explain just what I consider to be pagination: Pagination is any kind of control system that lets the user browse through pages of search results, archives, or any other kind of continued content. Search results are the o

import argparse
from mock import Mock
m = Mock()
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers()
query_group = subparsers.add_parser('query')
add_group = subparsers.add_parser('add')
@RobFreiburger
RobFreiburger / dateDeepCopy.js
Created March 23, 2012 01:25
How to Deep Copy a Date Object in JavaScript
// What works
var original = new Date();
var copy = new Date(original);
// What doesn't work
copy = original; // It should work, but it passes by reference so changes to copy also affect original
copy = jQuery.extend(true, {}, original); // Passes a useless object
#include <Python.h>
/*
* Usage
$ python
Python 2.7.3 |Anaconda 1.4.0 (64-bit)| (default, Feb 25 2013, 18:46:31)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-52)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import evil
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active November 15, 2024 17:43
set -e, -u, -o, -x pipefail explanation
@dguardado
dguardado / Procfile
Last active March 13, 2023 07:32
Starting an app with a shell script in elastic beanstalk
web: ./start_server.sh # would like to use environment variables here, but it is not supported
@hayd
hayd / tag_volume.config
Last active August 11, 2021 17:23
Tag Volumes in Elastic Beanstalk
container_commands:
tagVolume:
command: aws ec2 create-tags --resources $(aws ec2 describe-instances --region $(curl http://169.254.169.254/latest/meta-data/placement/availability-zone| sed 's/[a-z]$//') --instance-id $(curl http://169.254.169.254/latest/meta-data/instance-id ) --output text --query Reservations[0].Instances[0].BlockDeviceMappings[0].Ebs.VolumeId) --region $(curl http://169.254.169.254/latest/meta-data/placement/availability-zone| sed 's/[a-z]$//') --tags Key=Name,Value=$(/opt/elasticbeanstalk/bin/get-config container -k environment_name)