Skip to content

Instantly share code, notes, and snippets.

View rictorres's full-sized avatar
💅
startuppin'

Ricardo Torres rictorres

💅
startuppin'
View GitHub Profile
/* 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) {
@rictorres
rictorres / rwd-bookmarklet.js
Created June 8, 2013 09:01
I don't remember where I found this :(
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.
@rictorres
rictorres / import.php
Created May 31, 2013 05:48
import emails from wp comments
<?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
# ~/.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 / appcache.php
Last active December 17, 2015 04:18
Function to generate appcache manifest file and to automatically update itself (using md5 hashes).
<?php
header('Content-Type: text/cache-manifest');
header('Cache-Control: no-cache');
echo "CACHE MANIFEST\n\n";
$hashes = "";
$blacklist = array(
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 / trigram.html
Created September 10, 2012 03:56 — forked from tkadlec/trigram.html
Trigram for heaven icon
<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{
@rictorres
rictorres / responsive-testing.html
Created August 30, 2012 01:11
Responsive Design Testing
<!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 / .htaccess
Created July 16, 2012 21:27 — forked from necolas/.htaccess
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
@rictorres
rictorres / gist:3106467
Created July 13, 2012 18:24 — forked from luetkemj/wp-query-ref.php
WP: Query $args
<?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(