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 / 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');
@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);
}()),
@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.
{
"parser": "babel-eslint",
"extends": ["airbnb", "airbnb/hooks", "prettier"],
"plugins": ["react", "react-hooks", "prettier"],
"env": {
"browser": true,
"node": true,
"es6": true,
"jest": true
},
{
"trailingComma": "es5",
"semi": false,
"singleQuote": true,
"bracketSpacing": true,
"jsxBracketSameLine": false
}
@hullen
hullen / mongodb_3.2.x_security.md
Created January 17, 2017 18:54 — forked from leommoore/mongodb_3.2.x_security.md
MongoDB 3.2.x Security

#MongoDB 3.2.x Security

##Network Ports The standard ports used by mongo are:

ProcessRoleDefault Port
@hullen
hullen / gist:cd47fd5b0ab6cfc1e284db337d2c2242
Created August 23, 2016 20:18 — forked from sl4m/gist:5091803
create self-signed certificate for localhost
# SSL self signed localhost for rails start to finish, no red warnings.
# 1) Create your private key (any password will do, we remove it below)
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
@hullen
hullen / 0_reuse_code.js
Created November 24, 2013 01:33
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
{
"patterns": [
{
"pattern": "(console\\.log\\(.*?\\))",
"scopes": [
"storage.type.function.js",
"meta.function.json.js",
"source.js"
]
},
@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