Skip to content

Instantly share code, notes, and snippets.

@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

@davist11
davist11 / Fancy File Inputs.js
Created October 25, 2010 21:32
Fancy File Inputs
var SITE = SITE || {};
SITE.fileInputs = function() {
var $this = $(this),
$val = $this.val(),
valArray = $val.split('\\'),
newVal = valArray[valArray.length-1],
$button = $this.siblings('.button'),
$fakeFile = $this.siblings('.file-holder');
if(newVal !== '') {
@avk
avk / xhr_json_post.js
Created December 9, 2011 00:48
Titanium Mobile properly serializing JSON into a query string
var url = "http://localhost:3000";
var params = {
foo: 'bar',
stuff: [1,2,3]
};
var xhr = Ti.Network.createHTTPClient({
onload: function() {
alert("load!");
},
onerror: function() {
@esfand
esfand / customdao.md
Last active February 7, 2019 07:08
Spring Custom UserDetails

How to use Custom DAO class in Spring Security

Source

  • Objective 1 : Use Custom DAO classes in Spring Security Spring Security provides mechanism by which we can specify database queries in spring security xml file , but sometimes we want to use our own custom dao classes which are already built.
  • Objective 2 : Forward the request to different home pages based on the authorized role
@ewoutkramer
ewoutkramer / JsonTestPatient
Last active November 16, 2017 10:48
HL7 FHIR test patient in json, containing all corner cases for testing the json parser.
{
"resourceType": "Patient",
"identifier": [{
"label": "MRN",
"period": {"start": "2001-05-06"},
"assigner": {"display": "Acme Healthcare"},
"use": "usual",
"system": "urn:oid:1.2.36.146.595.217.0.1",
"value": "12345"
}],
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active May 16, 2025 13:41
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

Date: Tue, 30 Sep 2014 16:49:43 +0000
From: Louis Goff-Beardsley <[email protected]>
To: London Ruby Users Group <[email protected]>
Subject: [LRUG] [JOBS] Contracts Galore
Message-ID: <[email protected]>
Content-Type: text/plain; charset="iso-8859-1"
Hi LRUG,
Just a quick note, the yearly "Just got back from holiday, oh God we need more development done" contracts rush has come and we've been inundated with requests for upper-Mid level & Senior Ruby and/or Javascript contractors.
@vasanthk
vasanthk / System Design.md
Last active May 17, 2025 07:44
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@armanso
armanso / AES.java
Last active March 26, 2025 05:39
AES encryption/decryption in crypto-js way, use KDF for generating IV and Key, use CBC with PKCS7Padding for Cipher
import com.sun.jersey.core.util.Base64;
import java.io.UnsupportedEncodingException;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.util.Arrays;
import java.util.Random;
import javax.crypto.BadPaddingException;