Skip to content

Instantly share code, notes, and snippets.

View nandomoreirame's full-sized avatar
🎧
Working from home

Fernando Moreira nandomoreirame

🎧
Working from home
View GitHub Profile
@davbre
davbre / rails_commands
Created January 28, 2012 07:51
rails commands
rails generate model Modelname attr1:string attr2:integer
rails destroy model Modelname
rails generate migration add_user_id_to_posts user_id:integer
/* Delete and re-create */
rake db:drop
rake db:create
rake db:migrate
rake db:reset
@luetkemj
luetkemj / wp-query-ref.php
Last active September 14, 2024 13:06
WP: Query $args
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.github.io
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php
*/
@joshhartman
joshhartman / gist:2271523
Created April 1, 2012 04:54
Yahoo! Weather API Example Using SimpleXML in PHP
<?php
if(isset($_POST['zipcode']) && is_numeric($_POST['zipcode'])){
$zipcode = $_POST['zipcode'];
}else{
$zipcode = '50644';
}
$result = file_get_contents('http://weather.yahooapis.com/forecastrss?p=' . $zipcode . '&u=f');
$xml = simplexml_load_string($result);
//echo htmlspecialchars($result, ENT_QUOTES, 'UTF-8');
@fat
fat / gist:3744369
Created September 18, 2012 17:10
all you probably really need
/*! normalize-all-you-really-need-tho.css v1.0.0 | MIT License */
html {
font-family: sans-serif; /* 1 */
-webkit-text-size-adjust: 100%; /* 2 */
-ms-text-size-adjust: 100%; /* 2 */
}
body {
margin: 0;
@claudiosanches
claudiosanches / theme-options-functions.php
Created December 1, 2012 21:16
WordPress - Theme Settings Framework
<?php
// Esse é o arquivo com a base das funções.
// Tente não alterar ele.
/**
* Theme Options Functions
*/
/**
* Load options scripts
@unfulvio
unfulvio / functions.php
Last active July 15, 2021 05:17
WordPress HTML Minification Class to compress HTML (removal of whitespaces, line breaks, new lines, comments). Preserves script comments (if removed might break some javascripts like Google Analytics or Adsense) and IE specific tags.
/* Minifies HTML and removes comments (except IE tags and comments within script tags)
*
* To disable compression of code portions, use '<!--wp-html-compression no compression-->' tag
*
* @see http://forrst.com/posts/Wordpress_Minify_output_HTML-29q
* @see http://www.intert3chmedia.net/2011/12/minify-html-javascript-css-without.html
*/
class WP_HTML_Compression
{
// Settings
@fdaciuk
fdaciuk / functions.php
Created July 28, 2013 19:43
Adicionar metaboxes a pages específicas no WP
<?php
/*
Adicionar metabox à páginas específicas
*/
function my_meta_setup_1() {
// criação da metabox
}
function especific_metabox_pages() {
$post_ID = $_GET['post'] ? $_GET['post'] : $_POST['post_ID'];
@yamayo
yamayo / Gemfile
Last active January 10, 2019 19:29
AWS S3 upload/download with gzip
# A sample Gemfile
source 'https://rubygems.org'
gem 'aws-sdk'
gem 'pit'
@danasilver
danasilver / README.md
Last active November 6, 2017 12:48
Jekyll Pygments/Redcarpet Global Configs

Jekyll Pygments/Redcarpet Global Configs

A Jekyll plugin that enables global configuration options for Pygments.

  • Add pygments_global_config.rb to my-jekyll-project/_plugins/.

  • Add Pygments options to _config.yml

markdown: redcarpet
@bhwebworks
bhwebworks / Add custom metaboxes to WooCommerce products
Last active May 8, 2023 10:50
Add custom metaboxes to WooCommerce products
/**
* Create Custom Meta Boxes for WooCommerce Product CPT
*
* Using Custom Metaboxes and Fields for WordPress library from
* Andrew Norcross, Jared Atchinson, and Bill Erickson
*
* @link http://blackhillswebworks.com/?p=5453
* @link https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress
*/