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
#!/bin/bash
SNAPID="SNAP"
BACKUPDBID="TEMPDB"
#config groups
SECURITYGROUP="Mysecgrup"
PARAMSGROUP="Myparamsgrup"
#rds verifying commands
@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)
------------ 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)
require 'fileutils'
start_time = Time.now
SOURCE_DB = {
:name => 'db_name',
:user => 'db_user',
:password => 'db_pass',
:host => 'localhost'
<?php
/*
Plugin Name: Posts 2 Posts List Widget
Plugin URI: http://friendlywebconsulting.com/
Description: Creates a widget to display posts connected via the Posts 2 Posts plugin by Scribu, found here: http://wordpress.org/extend/plugins/posts-to-posts/
Author: Michelle McGinnis
Author URI: http://friendlywebconsulting.com/
Version: 1.0.0-alpha
*/
@everdaniel
everdaniel / jsonapi.md
Created December 10, 2013 03:03 — forked from wycats/jsonapi.md

JSON API

There are two JSON API styles:

  • The ID Style
  • The URL Style

The ID style is the easiest to get started with, but requires that your clients be able to guess the URLs for related documents. It also locks your API into a particular URL structure, which may become a problem as your API grows.

The URL style requires less guessing on the client side, and makes clients more resilient to API changes, but is trickier to use with relationships and compound documents.

@everdaniel
everdaniel / ex.js
Created January 21, 2016 00:41 — forked from JeffreyWay/ex.js
Laracasts.com Episode: Algolia + JavaScript + Vue
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Algolia with JS</title>
<link rel="stylesheet" href="app.css">
</head>
<body>
@everdaniel
everdaniel / WRF_example.ipynb
Created August 6, 2016 14:49 — forked from darothen/WRF_example.ipynb
Simple WRF analysis/plotting examples
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.