Skip to content

Instantly share code, notes, and snippets.

View chriscoyier's full-sized avatar

Chris Coyier chriscoyier

View GitHub Profile
Chriss-MacBook-Pro-4:codepen2 chriscoyier$ node --version
v0.8.20
{
"name": "example-project",
"version": "0.1.0",
"devDependencies": {
"gulp": "~3.4.0",
"gulp-util": "~2.2.14",
"gulp-autoprefixer": "0.0.6",
$color: #43BBC5;
@function shadow($count, $width, $size, $offset) {
$bs: ();
@for $i from 0 through $count {
$r: $width/2;
$x: $r*cos($i*2*pi()/$count + $offset) + px;
$y: $r*sin($i*2*pi()/$count + $offset) + px;
$bs: $bs, $x $y 0px $size + px $color;
}
/*!
{
"name": "SVG as an <img> tag source",
"property": "svgasimg",
"caniuse" : "svg-img",
"tags": ["svg"],
"authors": ["Stu Cox"],
"async" : true,
"notes": [{
"name": "HTML5 Spec",
<html class=""><head><meta charset="UTF-8">
<script src="http://s.ytimg.com/yts/jsbin/www-widgetapi-vfl5O9lF3.js" async=""></script><script src="//www.youtube.com/player_api"></script><script style="display: none !important;"> function getSafeJS(js) { js = js.replace(/location(s+)?=/mi, ''); js = js.replace(/top.location.+=('|")/mi, ''); js = js.replace(/location.replace/mi, ''); js = js.replace(/window(s+)?\[(s+)?("|')l/mi, ''); js = js.replace(/self(s+)?\[(s+)?("|')loc/mi, ''); return js; } _ogEval = window.eval; window.eval = function(text) {_ogEval(getSafeJS(text));}; window.innerWidth = window.outerWidth; // Fixes browser bug with it innerWidth reports 0 window.innerHeight = window.outerHeight; // Fixes browser bug with it innerHeight reports 0 </script>
<style></style></head><body>
<iframe id="video" width="640" height="480" src="//www.youtube.com/embed/FKWwdQu6_ok?enablejsapi=1" frameborder="0" allowfullscr

Tyler Pope

I've been doing front end web development for a few years. I'm in the process of building my first real web app. I am at the point in the project where it seems necessary to add user authentication. I am writing the app in PHP and am not using any frameworks. Since security is a big concern, I want to make sure I go about adding authentication correctly. I've been researching the best way to handle authentication and some have suggested to use pre-written scripts, while others have suggested using a framework. What should I do?

Adam Davidson

I would like to lazy load images on my website to speed up performance, however I am concerned about the fallback issues. As the images are loaded in via JavaScript, users without JavaScript will get no images.

Also not sure if the images will get indexed by Google, as they would not be in the DOM initially.

Will putting the images in a <noscript> tag solve this problem? What is your view on this?

[Fri Oct 04 13:47:17 2013] [warn] [client 68.34.220.203] mod_fcgid: stderr: PHP Notice: Undefined variable: form in /var/www/vhosts/css-tricks.com/httpdocs/examples/WebsiteChangeRequestForm/index.php on line 192, referer: http://css-tricks.com/sending-nice-html-email-with-php/
[Fri Oct 04 13:47:17 2013] [warn] [client 68.34.220.203] mod_fcgid: stderr: PHP Notice: Undefined index: WRCF-Name in /var/www/vhosts/css-tricks.com/httpdocs/examples/WebsiteChangeRequestForm/index.php on line 248, referer: http://css-tricks.com/sending-nice-html-email-with-php/
[Fri Oct 04 13:47:17 2013] [warn] [client 68.34.220.203] mod_fcgid: stderr: PHP Notice: Undefined index: WRCF-Email in /var/www/vhosts/css-tricks.com/httpdocs/examples/WebsiteChangeRequestForm/index.php on line 253, referer: http://css-tricks.com/sending-nice-html-email-with-php/
[Fri Oct 04 13:47:23 2013] [warn] [client 152.133.8.69] mod_fcgid: stderr: PHP Warning: Invalid argument supplied for foreach() in /var/www/vhosts/css-tricks.com/httpdocs/wp-admin/in
@chriscoyier
chriscoyier / Animated-Radio-Inputs.markdown
Last active December 22, 2015 08:08
A Pen by Oliver Knoblich.
@chriscoyier
chriscoyier / Pool.markdown
Created September 4, 2013 20:30
A Pen by Felix De Montis.
@chriscoyier
chriscoyier / index.haml
Created September 4, 2013 20:30
A Pen by Ana Tudor.
.boo