Skip to content

Instantly share code, notes, and snippets.

View nandomoreirame's full-sized avatar
🎯
Focusing

Fernando Moreira nandomoreirame

🎯
Focusing
View GitHub Profile
@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');
@luetkemj
luetkemj / wp-query-ref.php
Last active April 8, 2026 18:20
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
*/
@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