Skip to content

Instantly share code, notes, and snippets.

@hugodias
hugodias / hubspot_schema.html
Created January 31, 2019 10:12 — forked from lukebussey/hubspot_schema.html
HubSpot Blog Schema.org Markup
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Organization",
"@id": "#organization",
"name": "Outlyer",
"url": "https://www.outlyer.com/",
"sameAs": [
"https://github.com/outlyerapp",
"https://twitter.com/outlyer",
@hugodias
hugodias / gist:6072251
Created July 24, 2013 16:42
Syncing Sublime Text 2 Settings via Dropbox
Syncing Sublime Text 2 Settings via Dropbox
I just recently purchased Sublime Text 2 and thought I would do some digging into syncing the config files via Dropbox (affiliate link). There’s no real way of changing where Sublime looks for it’s file, but we can skirt this issue using symlinks. I run Sublime on Mac and a Windows machine, so I’ll post directions for both platforms.
WINDOWS
(has been tested on Sublime Text 2 build 2165 on Windows 7)
First, create a folder in your Dropbox path where you’d like to put your Sublime files. I used
@hugodias
hugodias / postmortem.md
Last active November 22, 2018 23:22 — forked from mlafeldt/postmortem.md
Post mortem Siteground - All servers down

Siteground (incident #1)

Date

2018-11-22

Authors

  • Hugo
@hugodias
hugodias / gist:7563544
Created November 20, 2013 13:55
Configure PhpStorm to play nicely with CakePHP
Wednesday, August 24, 2011
Configure PhpStorm to Auto-complete CakePHP Models, Views, and Controllers
After playing around a bit today I finally figured out how to get PhpStorm to auto-complete methods for models and controllers. Here's what you need to do.
Removing Multiple Definitions
First, let's tackle the multiple definitions problem that we see below.
@hugodias
hugodias / class-csv.php
Created August 29, 2018 01:04
Export wordpress table data in CSV format
<?php
/**
* Class CSV
*
* Export any wordpress table in CSV format
*
* @author Hugo Dias <hugoodias@gmail.com>
* @since 2.0.0
* @example $csv = new CSV('posts'); // Will export wp-posts table
*
@hugodias
hugodias / .htaccess
Last active August 17, 2018 15:21
CakePHP First HTACCESS for redirect from non-www to www
<IfModule mod_rewrite.c>
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} !^www\..+$ [NC]
RewriteCond %{HTTP_HOST} !=localhost [NC]
RewriteCond %{HTTP_HOST} !=127.0.0.1
RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine on

Keybase proof

I hereby claim:

  • I am hugodias on github.
  • I am hugodias (https://keybase.io/hugodias) on keybase.
  • I have a public key ASA7kVH998QnXA5NVATYEAVrLB-sahA9znxGxw0ge4YUygo

To claim this, I am signing this object:

@hugodias
hugodias / extras.php
Created July 14, 2018 14:38
Wordpress Reading time function with I18n Support
<?php
if ( ! function_exists( 'reading_time' ) ):
/**
* Display post reading time in minutes
*
* @param $post_content
*
* @return string
*/
@hugodias
hugodias / custom_logger.rb
Created July 11, 2018 17:13
Rails custom logger
# lib/custom_logger.rb
class CustomLogger
class << self
attr_accessor :logger
delegate :info, :warn, :debug, :error, :to => :logger
end
end
{
"name": "awesome-btn",
"version": "1.0.0",
"description": "",
"main": "build/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "webpack --watch",
"build": "webpack"
},