Skip to content

Instantly share code, notes, and snippets.

View paultreny's full-sized avatar

Paul Reny paultreny

View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>author</key>
<string>Lars H. Nielsen (translated by Tony Kemp)</string>
<key>name</key>
<string>Wombat</string>
<key>settings</key>
<array>

Javascript log Function

Every time I start a new project, I want to pull in a log function that allows the same functionality as the console.log, including the full functionality of the Console API.

There are a lot of ways to do this, but many are lacking. A common problem with wrapper functions is that the line number that shows up next to the log is the line number of the log function itself, not where log was invoked. There are also times where the arguments get logged in a way that isn't quite the same as the native function.

This is an attempt to once and for all document the function that I pull in to new projects. There are two different options:

  • The full version: Inspired by the plugin in HTML5 Boilerplate. Use this if you are writing an application and want to create a window.log function. Additionally,
{
"// my options for SublimeLinter " : "//",
"jshint_options" : {
"boss": true,
"browser": true,
"curly": false,
"devel": true,
"eqeqeq": false,
"eqnull": true,
AddHandler fcgid-script .fcgi
AddHandler cgi-script .cgi
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]

Mac web developer apps

This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.

— Erik

@paultreny
paultreny / index.html
Created June 13, 2013 04:40
A CodePen by Paul Reny. Form Feedback - Using jQuery and AJAX simulation to test feedback for invalid input and for sending the form successfully using animations.
<section id="contact-form">
<h2>Contact</h2>
<form id="contact" name="contact" accept-charset="utf-8">
<label><span>Name</span><input name="name" type="text" placeholder="Name"/></label>
<label><span>Email</span><input name="email" type="email" placeholder="Email"/></label>
<label><span>Message</span><textarea name="message" placeholder="Message"></textarea></label>
<input name="submit" type="submit" value="Send"/>
</form>
<aside>
<p>Fill in the form fields to see the success animation (no real validation, any random input will do)</p>
@paultreny
paultreny / index.html
Created June 13, 2013 04:48
A CodePen by Paul Reny.
<div class="photo">
<img src="http://lorempixum.com/200/200/people/9" />
</div>
@paultreny
paultreny / index.html
Created June 13, 2013 04:49
A CodePen by Paul Reny. Base for Pattern Rodeo
<form class="topLabel">
<header class="form-header">
<h2>A Form of Fantasy</h2>
<div>"The gift of fantasy has meant more to me than my talent for absorbing positive knowledge." - Albert Einstein</div>
</header>
<ul>
<li id="form-field-1">
@paultreny
paultreny / index.html
Created June 13, 2013 04:50
A CodePen by Paul Reny. Slideshow Form of Fantasy
<div id="background">
<form class="topLabel">
<header class="form-header">
<h2>A Form of Fantasy</h2>
<div>"The gift of fantasy has meant more to me than my talent for absorbing positive knowledge." - Albert Einstein</div>
</header>
<div id="steps">
<strong>Step 1</strong> <span>&raquo;</span> Step 2 <span>&raquo;</span> Step 3 <span>&raquo;</span> Step 4 <span>&raquo;</span> Step 5 <span>&raquo;</span> Finish
@paultreny
paultreny / index.html
Created June 13, 2013 05:03
A CodePen by Paul Reny. Freeman Style Guide - Style guide based off of the excellent example from nGen works (http://livewires.jellyfishmodel.com/style-guide.html)
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Freeman Style Guide</title>
<link href='http://fonts.googleapis.com/css?family=PT+Sans:400,700|Bitter:400,700' rel='stylesheet' type='text/css'>
</head>