Skip to content

Instantly share code, notes, and snippets.

View hullen's full-sized avatar
coffee & learn & code

Hullen Gonzales hullen

coffee & learn & code
View GitHub Profile
@hullen
hullen / PagingControl.js
Created April 30, 2012 12:50 — forked from raulriera/PagingControl.js
Custom paging control for scrollableViews for Titanium Appcelerator
// I was unhappy about there was close to no control over the "pageControl"
// in scrollableViews, so I hacked my own
// -----
var pages = [];
var page;
var numberOfPages = 0;
// Configuration
var pageColor = "#c99ed5";
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
@hullen
hullen / clearfix.css
Created February 14, 2013 23:13
A new micro clearfix hack
/**
* Clearfix based off this: http://nicolasgallagher.com/micro-clearfix-hack/
* For modern browsers
* Known support: Firefox 3.5+, Safari 4+, Chrome, Opera 9+, IE 6+
* 1. The space content is one way to avoid an Opera bug when the
* contenteditable attribute is included anywhere else in the document.
* Otherwise it causes space to appear at the top and bottom of elements
* that are clearfixed.
* 2. The use of `table` rather than `block` is only necessary if using
* `:before` to contain the top-margins of child elements.
@hullen
hullen / wp_sql_update_url.sql
Created February 15, 2013 01:55
Wordpress SQL Update for alter the URL changes when you publish your site. This SQL helps you to speed up update yours url values in tables of the database. Just replace your old url by your new url of the site. Code helped by my friend @akbortoli
UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldsite.com', 'http://www.newsite.com') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = REPLACE (guid, 'http://www.oldsite.com.br', 'http://www.newsite.com');
UPDATE wp_posts SET post_content = REPLACE (post_content, 'http://www.oldsite.com', 'http://www.newsite.com');
UPDATE wp_postmeta SET meta_value = REPLACE (meta_value, 'http://www.oldsite.com','http://www.newsite.com');

Mac web developer apps

This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.

— Erik

@hullen
hullen / get_gallery_attachments.php
Last active March 9, 2020 20:57
Extract images ids from gallery shortcode into post_content of the wordpress posts or custom post types.
# 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
@hullen
hullen / ios_mediaqueries.css
Last active December 21, 2015 01:08
iOS Media Queries
/**
iOS Media Queries
compatível com iPhone, iPhone 3G, iPhone 3GS, iPhone 4, iPhone 4S, iPad, and iPad 2
Author @hullen
Fique a vontade em utilizar, colaborar e compartilhar!
*/
/**
iPhone (4/4S) - modo paisagem
cor do link: laranja com fundo verde
{
"patterns": [
{
"pattern": "(console\\.log\\(.*?\\))",
"scopes": [
"storage.type.function.js",
"meta.function.json.js",
"source.js"
]
},
@hullen
hullen / mobileCheck.js
Last active May 23, 2021 12:49
Detects mobile devices: phones, tablets. mobileCheck is a lightweight Javascript utils for detecting mobile devices and tablets. Its using User Agent string. Usage: if ( mobileCheck.smarphone ) { // Code }
var mobileCheck = {
ios: (function(){
return navigator.userAgent.match(/iPhone|iPad|iPod/i);
}()),
android: (function(){
return navigator.userAgent.match(/Android/i);
}()),
blackBerry: (function(){
return navigator.userAgent.match(/BB10|Tablet|Mobile/i);
}()),