Skip to content

Instantly share code, notes, and snippets.

View andreiluca's full-sized avatar

Andrei Luca andreiluca

View GitHub Profile
@abrudtkuhl
abrudtkuhl / comments.php
Created August 8, 2012 18:05
WordPress comments.php for Responsive Facebook Comments
<div class="fb-comments"data-href="<?php the_permalink(); ?>" data-num-posts="2" mobile="false"></div>
(function(global) {
var silpUrl = '//s3-eu-west-1.amazonaws.com/silp.shootitlive.com/js/silp.min.js';
// Globals
if(!global.Silp) { global.Silp = {}; };
var Silp = global.Silp;
// To keep track of which embeds we have already processed
if(!Silp.foundEls) Silp.foundEls = [];
@necolas
necolas / .htaccess
Created April 9, 2012 22:19
Simple, quick way to concatenate, minify, and version static files in a Wordpress theme
# Filename-based cache busting
# taken from https://github.com/h5bp/html5-boilerplate/
# This rewrites file names of the form `name.123456.js` to `name.js`
# so that the browser doesn't use the cached version when you have
# updated (but not manually renamed) the file.
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
@oodavid
oodavid / README.md
Last active April 6, 2024 18:45 — forked from aronwoost/README.md
Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
@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.
*
@chrisguitarguy
chrisguitarguy / mask-links.php
Created December 14, 2011 14:38
Mask external WordPress links behind a redirect.
<!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" />
@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;
}
@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() ) {
@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