Skip to content

Instantly share code, notes, and snippets.

View jitendravyas's full-sized avatar

Jitendra Vyas jitendravyas

View GitHub Profile
// Released under MIT license: http://www.opensource.org/licenses/mit-license.php
$('[placeholder]').focus(function() {
var input = $(this);
if (input.val() == input.attr('placeholder')) {
input.val('');
input.removeClass('placeholder');
}
}).blur(function() {
var input = $(this);
@lsmith
lsmith / iOS_details_arrow.css
Created March 6, 2011 07:56
The CSS to create an iOS details call-to-action arrow
/* assumes .details is position: relative */
.details::after {
content: '';
position: absolute;
border-top: 3px solid #7f7f7f;
border-right: 3px solid #7f7f7f;
height: 6px;
width: 6px;
top: 50%;
right: 12px;
@nathansmith
nathansmith / web-design-development-learning-resources.md
Last active April 7, 2024 13:04
Resources for learning web design & front-end development
@necolas
necolas / snippet.js
Created June 14, 2011 20:36
Optimised async loading of cross-domain scripts
/*
* Updated to use the function-based method described in http://www.phpied.com/social-button-bffs/
* Better handling of scripts without supplied ids.
*
* N.B. Be sure to include Google Analytics's _gaq and Facebook's fbAsyncInit prior to this function.
*/
(function(doc, script) {
var js,
fjs = doc.getElementsByTagName(script)[0],
@mrowl
mrowl / config.rb
Created September 2, 2011 20:18
Generating Tornado style static urls in Sass
require 'digest/md5'
module Sass::Script::Functions
# Returns a url for static media (e.g. an icon) consistent with those
# generated by the static_url method in Tornado templates. The method
# takes an md5 hash of the given file and attaches the first five chars to
# the 'v' GET param in the url (i.e. it appends "?v=<hash_slice>").
# Assumes you use a somewhat conventional Tornado layout:
# myapp/myapp - your code
@dideler
dideler / bootstrapping.md
Last active May 8, 2024 14:38
Bootstrapping - a list of useful resources to get up and running quickly

Welcome!

UPDATE: This list is no longer maintained. I've moved it to its own repo so you can send suggestions as Pull Requests. https://github.com/dideler/bootstrapping/

For feedback or suggestions, please send a tweet (@dideler). Gist comments don't notify me. Pull requests aren't possible with gists (yet), so I don't recommend forking because then I can't easily get the change.

Starring this gist will give me an idea of how many people consider this list useful.

Here's how to install PostgreSQL and have it run automatically at startup, on an Ubuntu 10.04 virtual machine using Vagrant. This took me a while to figure out:

Add the default lucid32 base box to your vagrant, if you haven't already:

host> vagrant box add lucid32 http://files.vagrantup.com/lucid32.box 

Now make a new lucid32 virtual machine and install postgresql on it:

@kevinSuttle
kevinSuttle / meta-tags.md
Last active March 31, 2024 14:26 — forked from lancejpollard/meta-tags.md
List of Usable HTML Meta and Link Tags
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@collinschaafsma
collinschaafsma / rails-grunt.js
Created April 10, 2012 03:43
Grunt config for Rails
// This is the main application configuration file. It is a Grunt
// configuration file, which you can learn more about here:
// https://github.com/cowboy/grunt/blob/master/docs/configuring.md
//
module.exports = function(grunt) {
grunt.initConfig({
// The clean task ensures all files are removed from the dist/ directory so
// that no files linger from previous builds.