Skip to content

Instantly share code, notes, and snippets.

// ==UserScript==
// @name UTM param stripper
// @author Paul Irish
// @namespace http://github.com/paulirish
// @version 1.1
// @description Drop the UTM params from a URL when the page loads.
// @extra Cuz you know they're all ugly n shit.
// @include http://*
// ==/UserScript==
function countCSSRules() {
var results = '',
log = '';
if (!document.styleSheets) {
return;
}
for (var i = 0; i < document.styleSheets.length; i++) {
countSheet(document.styleSheets[i]);
}
function countSheet(sheet) {

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">
# ignore everything in this directory
/*
# but not these
!.gitignore
!assets/
!core/
!_SASS/
!_JS/
<?php
/**
* MODX Revolution OnElementNotFound plugin
* Add static elements inside categories for defined packages OnElementNotFound
*
* Author: Jeroen Kenters / www.kenters.com
* Version: 1.0.0-beta
* License: GPL
*
* Warning:
<?
///////////////////////////////////////
// sanitize.inc.php
// Sanitization functions for PHP
// by: Gavin Zuchlinski, Jamie Pratt, Hokkaido
// webpage: http://libox.net
// Last modified: September 27, 2003
//
// Many thanks to those on the webappsec list for helping me improve these functions
///////////////////////////////////////
@mrhaw
mrhaw / README.md
Last active August 29, 2015 14:23 — forked from sarciszewski/README.md

Aniruddh Agarwal blogged A short tour of PHP, and this is one of the negatives he identified:

Community: I know. I said that PHPs community was an advantage to it, but it is also a disadvantage, because of BAD CODE. Beginners are not taught the best practices and they go on to write bad code and distribute it, either as answers on Stack Overflow or similar websites or blog about it, which encourages other beginners to adopt those practices. There is a lot of misinformation out there, and it is very difficult to separate the good from the bad. This is perhaps the worst thing about PHP, because PHP is an entry-level language and people learning it are usually not aware of the best practices.

This is spot on!

The existence of BAD CODE being copied and pasted by newcomers is probably the biggest source of exploitable security vulnerabilities in the entire industry.

The biggest offenders are often the highest ranking search results on Google and other search eng

/*==================================================
= Bootstrap 3 Media Queries =
==================================================*/
/*========== Mobile First Method ==========*/
/* Custom, iPhone Retina */
@media only screen and (min-width : 320px) {
}
@mrhaw
mrhaw / updatefromelement.class.php
Last active August 27, 2015 21:23 — forked from Fi1osof/processor.php
modx240 fix revolution/core/model/modx/processors/element/propertyset/updatefromelement.class.php
<?php
// https://github.com/modxcms/revolution/issues/12580
include_once dirname(__FILE__).'/update.class.php';
/**
* Saves a property set
*
* @package modx
* @subpackage processors.element.propertyset
*/