Skip to content

Instantly share code, notes, and snippets.

View adamculpepper's full-sized avatar

Adam Culpepper adamculpepper

View GitHub Profile
var cache = {};
function checkCache(key){
if(cache[key]){
return cache[key];
} else {
// do some long/expensive action
// ex: calculation, ajax, etc...
cache[key] = Math.random();
return cache[key];
}
@rxaviers
rxaviers / gist:7360908
Last active May 15, 2025 03:32
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: ๐Ÿ˜„ :smile: ๐Ÿ˜† :laughing:
๐Ÿ˜Š :blush: ๐Ÿ˜ƒ :smiley: โ˜บ๏ธ :relaxed:
๐Ÿ˜ :smirk: ๐Ÿ˜ :heart_eyes: ๐Ÿ˜˜ :kissing_heart:
๐Ÿ˜š :kissing_closed_eyes: ๐Ÿ˜ณ :flushed: ๐Ÿ˜Œ :relieved:
๐Ÿ˜† :satisfied: ๐Ÿ˜ :grin: ๐Ÿ˜‰ :wink:
๐Ÿ˜œ :stuck_out_tongue_winking_eye: ๐Ÿ˜ :stuck_out_tongue_closed_eyes: ๐Ÿ˜€ :grinning:
๐Ÿ˜— :kissing: ๐Ÿ˜™ :kissing_smiling_eyes: ๐Ÿ˜› :stuck_out_tongue:
@sanand0
sanand0 / textarea-maxlength.js
Created September 7, 2010 07:17
Restricts number of characters to maxlength in textarea
// Textarea maxlength
// Ensures that textarea's maxlength is validated
//
// (c) S Anand, 2010, MIT License
// Credits: http://yelotofu.com/2009/12/jquery-textarea-max-length/
// Credits: http://stackoverflow.com/questions/43569/max-length-for-html-text-areas
(function() {
var ignore = [8,9,13,33,34,35,36,37,38,39,40,46];
function limit(event) {
@patrys
patrys / jquery.placeholder.js
Created August 3, 2010 14:43
Fallback code for the HTML5 "placeholder" attribute
$(function() {
if (!('placeholder' in document.createElement('input'))) {
$('input[placeholder], textarea[placeholder]').each(function() {
var text = this.getAttribute('placeholder');
var fld = $(this);
function setPlaceholder() {
if (fld.val() == text || fld.val() == '') {
fld.addClass('jqPlaceholder');
fld.val(text);
// Before hiding all the inactive togglables, hard-code their height so
// the jQuery effect isn't choppy.
// See http://stackoverflow.com/questions/1092245/basic-jquery-slideup-and-slidedown-driving-me-mad
$(".togglable").each(function(){
$(this).css("height", $(this).height());
});
// Passive way of hiding stuff that should be hidden.
// This way it won't be for users with js disabled.
$(".inactive").hide();