Skip to content

Instantly share code, notes, and snippets.

View chriscoyier's full-sized avatar

Chris Coyier chriscoyier

View GitHub Profile
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active May 3, 2024 12:59
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@maxfenton
maxfenton / a-new-mac-setup.md
Last active April 17, 2024 10:55
System setup stuff for a new OLD mac (a/o 2020)

New computer setup

a/o 2020-05-29

--

Format the drive

  1. Restart with Cmd-R or Cmd-D
  2. Erase drive / 3x if second-hand
  3. Reinstall MacOS
@stephenharris
stephenharris / bbpress-kses.php
Last active February 3, 2020 08:44
By default bbpress can be quite strict on the HTML it allows in posts (tags are whitelisted). The following loosens those restrictions and is taken from this post: http://buddypress.org/support/topic/tutorial-allow-more-html-tags-in-bp-forum-topics/
<?php
function myprefix_kses_allowed_tags($input){
return array_merge( $input, array(
// paragraphs
'p' => array(
'style' => array()
),
'span' => array(
'style' => array()
),
<?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';
@norcross
norcross / url-spamcheck.php
Created April 26, 2013 17:41
checks the URL posted by a commenter
<?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';
@zachleat
zachleat / jquery.postmessage.js
Created April 10, 2013 14:21
postMessage polyfill for IE < 8 that uses window.name and queues messages so they aren't lost while polling. Requires a JSON.parse polyfill (like JSON.js).
/*!
* jQuery postMessage - v1.0 - 8/26/2011
*
* Copyright (c) 2011 "zachleat" Zach Leatherman
* Copyright (c) 2009 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://jquery.org/license
*/
/* Forked from http://benalman.com/projects/jquery-postmessage-plugin/
@joshefin
joshefin / gist:4506897
Created January 11, 2013 00:11
Multipart cross domain post request with ajax
var data = new FormData();
form.find("input, textarea").each(function() {
var input = $(this);
if (input.attr("type") == "file")
data.append(input.attr("name"), input[0].files[0]);
else
data.append(input.attr("name"), input.val());
});
$.ajax({
@include handhelds {
table.responsive {
width: 100%;
thead {
display: none;
}
tr {
display: block;
}
td, th {
@PeteMall
PeteMall / filter-upload-mime-types.php
Created October 11, 2012 18:08
Add SVG to the allowed mime types in WordPress
function cc_mime_types( $mimes ){
$mimes['svg'] = 'image/svg+xml';
return $mimes;
}
add_filter( 'upload_mimes', 'cc_mime_types' );
@mikefowler
mikefowler / mq.scss
Created October 3, 2012 18:40
Retina Media Queries for Sass
// Based on Chris' post here: https://gist.github.com/3828790
@mixin respond-to($size) {
// Small
@if $size == "small" {
@media only screen and (min-width: 320px) {
@content;
}