This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Run from the command line, so we'll grab arguments from there | |
// input arguments: 0=>script, 1=>file_name, 2=>temp_file | |
$file_name = $argv[1]; | |
$temp_file = $argv[2]; | |
$uploads = '/opt/lampp/htdocs/user_uploads/'; | |
// Set up file location strings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
| PHP: http_build_query() | |
| my first Schnippsel - Robs | |
*/ | |
http_build_query() | |
takes array ($_POST,$_GET array("schnipp"=>"schnapp")) | |
returns url-encoded string (schnipp=schnapp&plitsch=platsch&bam=bam) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Unserialize (to) form plugin - by Christopher Thielen | |
// adapted and desuckified (a little) by Paul Irish | |
// takes a GET-serialized string, e.g. first=5&second=3&a=b and sets input tags (e.g. input name="first") to their values (e.g. 5) | |
(function($) { | |
$.fn.unserializeForm = function(values) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// from https://twitter.com/#!/LeaVerou/status/16613276313980929 | |
// this pattern below is common for using an incoming value otherwise using some default. | |
/* Bad: */ x = x ? x : y; // simple ternary. | |
// if x is truthy lets use it. | |
/* Better: */ x = x || y; // logical OR. | |
// you could string a bunch of these easily to grab the first non-falsy value: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* matchMedia() polyfill - test whether a CSS media type or media query applies | |
* authors: Scott Jehl, Paul Irish, Nicholas Zakas | |
* Copyright (c) 2010 Filament Group, Inc | |
* MIT license | |
* dev.w3.org/csswg/cssom-view/#dom-window-matchmedia | |
* in Chrome since m10: http://trac.webkit.org/changeset/72552 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- so it turns out that the object tag can act like an iframe | |
but the cool thing is you can nest object tags inside eachother for a fallback path. | |
what this means is you can "objectframe" a site.. and if it fails.. (site down, offline, whatever).. it'll use the next one. | |
so you can objectframe the live site and fallback to a screenshot. | |
or something. | |
demo at : http://jsfiddle.net/paul/CY2FQ/1/ | |
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo " | |
Cool, let's start. | |
" | |
src=$PWD |