Skip to content

Instantly share code, notes, and snippets.

View chriscoyier's full-sized avatar

Chris Coyier chriscoyier

View GitHub Profile
@chriscoyier
chriscoyier / wp_css_tricks_images_responsive.php
Last active February 28, 2016 15:56 — forked from joemcgill/wp_css_tricks_images_responsive.php
CSS Tricks Responsive Image Filter
<?php
// I could use some help with this.
// It looks SUPER close to working, but at the final moment, it doesn't.
// Example post HTML
// https://gist.github.com/chriscoyier/27954c6e12c96fadeb6f
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="google" value="notranslate">
<title>CodePen Overloaded</title>
<style>
@chriscoyier
chriscoyier / gist:5801571
Last active December 18, 2015 14:59 — forked from anonymous/gist:5801482
<?php
$src = '<iframe src="http://player.vimeo.com/video/68302803" width="500" height="281" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';
$matches = preg_match('/player\.vimeo\.com\/video\/(\d+)/', $src, $match);
if ($matches) {
$id = $match[1];
$apiurl = 'http://vimeo.com/api/v2/video/' . $id . '.json';
$response = file_get_contents($apiurl);
$json = json_decode($response, true);
<?php
function rkv_url_spamcheck( $approved , $commentdata ) {
$author_url = $commentdata['comment_author_url'];
$author_url_length = strlen($author_url);
if ($author_url_length > 50 )
$approved = 'spam';
body {
font-family: sans-serif;
}
ul {
list-style: none
}
li {
background: slategrey;
@chriscoyier
chriscoyier / dabblet.css
Created February 29, 2012 18:55 — forked from JosephSilber/dabblet.css
CSS Pac-Man BUG IN CHROME 17 WINDOWS
/* CSS Pac-Man BUG IN CHROME 17 WINDOWS */
#pacman {
width: 0;
height: 0;
border: 60px solid red;
border-right-color: transparent;
border-radius: 50%;
}
@chriscoyier
chriscoyier / dabblet.css
Created February 24, 2012 03:56 — forked from telic/dabblet.css
Lined Paper
/**
* Lined Paper
*/
html {
background-color:white;
padding:10px;
font-family:sans-serif; font-size:15px;
}
body {
@chriscoyier
chriscoyier / dabblet.css
Created February 22, 2012 19:22 — forked from anonymous/dabblet.css
pseudo element as background-size
/* pseudo element as background-size */
* {
margin: 0;
padding: 0;
}
p {
position: relative;
height: 400px;
font-size: 100px;
@chriscoyier
chriscoyier / dabblet.css
Created February 22, 2012 19:22 — forked from anonymous/dabblet.css
pseudo element as background-size
/* pseudo element as background-size */
* {
margin: 0;
padding: 0;
}
p {
position: relative;
height: 400px;
font-size: 100px;
@chriscoyier
chriscoyier / dabblet.css
Created February 22, 2012 19:22 — forked from anonymous/dabblet.css
pseudo element as background-size
/* pseudo element as background-size */
* {
margin: 0;
padding: 0;
}
p {
position: relative;
height: 400px;
font-size: 100px;