Skip to content

Instantly share code, notes, and snippets.

Avatar
💅
startuppin'

Ricardo Torres rictorres

💅
startuppin'
View GitHub Profile
View gist:3106467
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(
@rictorres
rictorres / .htaccess
Created Jul 16, 2012 — forked from necolas/.htaccess
Simple, quick way to concatenate, minify, and version static files in a Wordpress theme
View .htaccess
# 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
@rictorres
rictorres / responsive-testing.html
Created Aug 30, 2012
Responsive Design Testing
View responsive-testing.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Responsive Design Testing</title>
<style>
body { margin: 20px; font-family: sans-serif; overflow-x: scroll; }
.wrapper { width: 6000px; }
.frame { float: left; }
h2 { margin: 0 0 5px 0; }
@rictorres
rictorres / trigram.html
Created Sep 10, 2012 — forked from tkadlec/trigram.html
Trigram for heaven icon
View trigram.html
<html>
<head>
<title>Trigram for heaven icon</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width" />
<style type="text/css">
li {
list-style-type: none;
}
#menu{
View autogrow.js
function autogrow(textarea) {
// create fake div with same content
// (only works with box-sizing border-box)
var dv = document.createElement("div");
dv.className = 'fm-growable';
dv.style.visibility="hidden";
dv.style.position="absolute";
textarea.parentNode.appendChild(dv);
@rictorres
rictorres / appcache.php
Last active Dec 17, 2015
Function to generate appcache manifest file and to automatically update itself (using md5 hashes).
View appcache.php
<?php
header('Content-Type: text/cache-manifest');
header('Cache-Control: no-cache');
echo "CACHE MANIFEST\n\n";
$hashes = "";
$blacklist = array(
View gist:5608000
# ~/.osx — http://mths.be/osx
# root check
if [[ $EUID -ne 0 ]]; then
echo "################################";
echo "## YOU ARE NOT RUNNING AS ROOT #";
echo "################################";
echo "#";
echo "# USAGE: sudo $0";
exit;
@rictorres
rictorres / import.php
Created May 31, 2013
import emails from wp comments
View import.php
<?php
$db = new mysqli('host', 'user', 'pass', 'bd');
$sql = "SELECT comment_author_email, comment_author
FROM `wp_comments`
WHERE comment_author_email <> ''
GROUP BY comment_author_email
ORDER BY (
comment_author_email
@rictorres
rictorres / rwd-bookmarklet.js
Created Jun 8, 2013
I don't remember where I found this :(
View rwd-bookmarklet.js
javascript:void((function()%7Bvar d%3Ddocument%3Bd.write(%27<!DOCTYPE html><html><head><meta charset%3D"UTF-8"><title>%27%2Bd.title%2B%27 - Responsive test</title><link rel%3D"stylesheet" href%3D"http://responsive.victorcoulon.fr/assets/css/app.css"><script src%3D"http://responsive.victorcoulon.fr/assets/js/app.min.js"></script></head><body><header><div class%3D"close"><a href%3D"%23">×</a></div><div id%3D"size"></div><div class%3D"keyboard"><a href%3D"%23">I</a></div><div class%3D"cssrefresh"><a href%3D"%23">I</a></div><div id%3D"devices"><a href%3D"%23" class%3D"tablet-portrait"><span>Tablet Portrait</span></a><a href%3D"%23" class%3D"tablet-landscape"><span>Tablet Landscape</span></a><a href%3D"%23" class%3D"smartphone-landscape"><span>iPhone Landscape</span></a><a href%3D"%23" class%3D"smartphone-portrait"><span>iPhone Portrait</span></a><a href%3D"%23" class%3D"auto active"><span>Auto</span></a></div></header><section><div id%3D"wrapper"><iframe src%3D"%27%2Bd.URL%2B%27" onLoad%3D"resbook.changeUrl(this.
View media-queries.css
/* Smartphones (portrait and landscape) ----------- */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px) {
/* STYLES GO HERE */
}
/* Smartphones (landscape) ----------- */
@media only screen
and (min-width : 321px) {