Skip to content

Instantly share code, notes, and snippets.

View travismillerweb's full-sized avatar

Travis Miller travismillerweb

View GitHub Profile
@paulirish
paulirish / gist:4158604
Created November 28, 2012 02:08
Learn JavaScript concepts with recent DevTools features

Learn JavaScript concepts with the Chrome DevTools

Authored by Peter Rybin , Chrome DevTools team

In this short guide we'll review some new Chrome DevTools features for "function scope" and "internal properties" by exploring some base JavaScript language concepts.

Closures

Let's start with closures – one of the most famous things in JS. A closure is a function, that uses variables from outside. See an example:

@mieky
mieky / html5-camera-test.html
Last active March 28, 2022 08:00
HTML5 camera test
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>HTML5 camera test</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
</head>
<body>
<form>
@ataylorme
ataylorme / custom-menu-shortcode
Created November 17, 2012 22:40
Custom Menu Shortcode
// Function that will return Wordpress menu
function custom_menu($atts, $content = null) {
extract(shortcode_atts(array(
'menu' =&gt; '',
'container' =&gt; 'div',
'container_class' =&gt; '',
'container_id' =&gt; '',
'menu_class' =&gt; 'menu',
'menu_id' =&gt; '',
'echo' =&gt; true,
@malarkey
malarkey / Contract Killer 3.md
Last active May 24, 2024 23:38
The latest version of my ‘killer contract’ for web designers and developers

When times get tough and people get nasty, you’ll need more than a killer smile. You’ll need a killer contract.

Used by 1000s of designers and developers Clarify what’s expected on both sides Helps build great relationships between you and your clients Plain and simple, no legal jargon Customisable to suit your business Used on countless web projects since 2008

…………………………

@luqmaan
luqmaan / gist:3975949
Created October 29, 2012 19:27
Strip the MailChimp email templates of their comments
@harthur
harthur / snippet.md
Created June 18, 2012 22:12
console.log() key binding for Sublime Text

Go to Sublime Text 2 > Preferences > Key Bindings - User and add this JSON to the file:

[
    { "keys": ["super+shift+l"],
      "command": "insert_snippet",
      "args": {
        "contents": "console.log(${1:}$SELECTION);${0}"
      }
 }
@ancillaryfactory
ancillaryfactory / .gitignore
Created March 7, 2012 01:24 — forked from redoPop/.gitignore
Wordpress: Template .gitignore file
# This is a template .gitignore file for git-managed WordPress projects.
#
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
#
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
#
# See the comments below for more info on how to add exceptions for your
@MatthewEppelsheimer
MatthewEppelsheimer / state-shortcode.php
Created December 19, 2011 20:10
WP Contact Form 7 shortcode with list of United States
<?php
[select member-1-state "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" "--" "District of Columbia" "Puerto Rico" "Guam" "American Samoa" "U.S. Virgin Islands" "Northern Mariana Islands"]
@mfkp
mfkp / index.html
Created December 17, 2011 01:39
mailchimp ajax signup form example
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="jquery.ketchup.all.min.js" type="text/javascript"></script>
</head>
<body>
<div id="email">
<span>Enter your email to sign up</span>
<form action="/subscribe.php" id="invite" method="POST">
@rbochet
rbochet / MapsApiv3.html
Created March 27, 2011 05:17
Google Maps API v3: LatLngBounds and multiple infoWindows
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<link href="http://code.google.com/apis/maps/documentation/javascript/examples/default.css" rel="stylesheet" type="text/css" />
<title>API Maps v3: Multiple infoWindows and zoom issues</title>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
var sites = [
['Darlington', -35.0252820, 138.5630230, 1, 'Darlington, where I am living.<br/><a href="http://www.flickr.com/photos/rbochet/5560158585/" title="Figue agressive de Romain Bochet, sur Flickr"><img src="http://farm6.static.flickr.com/5030/5560158585_c9a6919140_m.jpg" width="240" height="160" alt="Figue agressive" /></a><br/>See my <a href="http://www.flickr.com/photos/rbochet/sets/72157625988396879/">Flickr album</a>'],