Skip to content

Instantly share code, notes, and snippets.

View andreiluca's full-sized avatar

Andrei Luca andreiluca

View GitHub Profile
@paulirish
paulirish / utmstrip.user.js
Last active April 11, 2024 07:53
userscript: Drop the UTM params from a URL when the page loads
// ==UserScript==
// @name UTM param stripper
// @author Paul Irish
// @namespace http://github.com/paulirish
// @version 1.2
// @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==
@danott
danott / jquery.scroll-lock.js
Created February 21, 2011 21:22
Apple Cart style scroll lock
We couldn’t find that file to show.
@chrisguitarguy
chrisguitarguy / custom-shortlink.php
Created August 29, 2011 22:14
Adds a custom shortlink structure to WordPress
@vasilisvg
vasilisvg / responsive-context-images.html
Created September 7, 2011 10:50
Responsive context aware images without cookies or server logic
<!doctype html>
<!--
WARNING!
You probably shouldn't use this technique since images never show up
if the script isn't loaded for one reason or another. Some reasons:
- The content is viewed using a RSS reader
- The content is viewed with a read-it-later service
- The user has a flaky connection (hotel wifi, Dutch train, etc)
-->
@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@scribu
scribu / network-quick-switch.php
Created September 10, 2011 16:23
Network Quick-Switch
<?php
/*
Plugin Name: Network Quick-Switch
Version: 1.0
Description: Adds the ability to quickly switch between site and network admin screens.
Author: scribu
Author URI: http://scribu.net/
*/
if ( is_multisite() ) {
@scribu
scribu / wrapping.php
Last active January 7, 2024 11:59
Theme wrapping
<?php
# License: Public Domain
# I recommend replacing 'my_' with your own prefix.
function my_template_path() {
return My_Wrapping::$main_template;
}
<!DOCTYPE html>
<html>
<head prefix="og: http://ogp.me/ns# og_recipebox: http://ogp.me/ns/apps/example#">
<meta property="fb:app_id" content="YOUR_APP_ID" />
<meta property="og:url" content="http://example.vom/cookie.html">
<meta property="og:type" content="example:recipe" />
<meta property="og:title" content="Oreo Stuffed Cookies" />
<meta property="og:image" content="http://example.com/cookie.jpg" />
<meta property="og:description" content="The Turducken of Cookies" />
@chrisguitarguy
chrisguitarguy / mask-links.php
Created December 14, 2011 14:38
Mask external WordPress links behind a redirect.
@GaryJones
GaryJones / gist:1517555
Created December 24, 2011 15:26
Display some widgets from a sidebar in random order
<?php
add_filter( 'sidebars_widgets', 'gmj_shuffle_widgets' );
/**
* Shuffle ranges of widgets within a sidebar.
*
* Hat-tip to {@link http://gmj.to/op} for the original idea.
*
* @uses gmj_do_shuffle_widgets() Does the actual array manipulation.
*