Skip to content

Instantly share code, notes, and snippets.

View everdaniel's full-sized avatar
🏠
Working from home

Ever Daniel Barreto everdaniel

🏠
Working from home
View GitHub Profile
@everdaniel
everdaniel / mysql-populate-from-select.sql
Created January 16, 2013 18:59
MySQL -- Crear tabla temporal con consulta y popular tabla con consulta
--
-- Add Brentwood Employees
--
INSERT INTO employee_brentwood (
user_name,
user_firstname,
user_surname,
user_email,
user_password,
user_level,
@everdaniel
everdaniel / functions.php
Created February 6, 2013 21:05
JS Namespace en WordPress
// Define Esencia JS Namespace
function esencia_js_namespace() {
?><script type="text/javascript">
/* <![CDATA[ */
// Global Esencia Namespace
window.esencia = window.esencia || {};
// Theme Namespace
esencia.theme = esencia.theme || {};
@everdaniel
everdaniel / widget-cine.php
Created February 15, 2013 19:16
Get Custom Posts
<?php
$args = array(
'numberposts' => 18,
'orderby' => 'post_date',
'post_type' => 'cartelera'
);
$posts = get_posts( $args );
if ( count( $posts ) > 0 ) :
?>
<div class="cinema">
@everdaniel
everdaniel / itau.rb
Created April 12, 2013 12:18 — forked from foca/itau.rb
# encoding: UTF-8
require 'mechanize'
require 'money'
require 'ostruct'
module Itau
class Session < Struct.new(:ci, :pass)
def login
login_page = agent.get(itaurl)
@everdaniel
everdaniel / dashboard.php
Created April 13, 2013 21:35
Demo files from a Management Application for the Hospitality Industry
<?php
/**
* Dashboard Controller
*
**/
class Dashboard extends Controller
{
/**
* dashboard::dashboard()
@everdaniel
everdaniel / MY_Controller.php
Created April 13, 2013 21:47
Demo files for a Competition site built for Cisco Saudi Arabia
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
* Base Controller
*
*/
class MY_Controller extends Controller
{
/**
* Auth Library
@everdaniel
everdaniel / GRR_Admin_Controller.php
Last active December 16, 2015 04:49
Demo files from a competition site built for an Ad Agency
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Base Admin Controller
*
*/
class GRR_Admin_Controller extends CI_Controller
{
/**
* Assets (JS/CSS) from the Controllers
*
------------ From Rake Task
namespace :app do
# Checks and ensures task is not run in production.
task :ensure_development_environment => :environment do
if Rails.env.production?
raise "\nI'm sorry, I can't do that.\n(You're asking me to drop your production database.)"
end
end
#!/usr/bin/ruby
# encoding: utf-8
#
# Retrieve an iOS app icon at the highest available resolution
# All arguments are combined to create an iTunes search
# The icon for the first result, if found, is written to a filename based on search terms
#
# example:
# $ itunesicon super monsters ate my condo
# MultIO Ruby IO multiplexer
# http://rcrowley.org/2010/07/27/multio-ruby-io-multiplexer.html
require 'stringio'
class MultIO < Array
def <<(io)
if io.respond_to?(:to_str)
io = StringIO.new(io)