Skip to content

Instantly share code, notes, and snippets.

View shadowmaru's full-sized avatar
Codeberg. Same handle.

Ricardo Shiota Yasuda shadowmaru

Codeberg. Same handle.
View GitHub Profile

Keybase proof

I hereby claim:

  • I am shadowmaru on github.
  • I am shadowmaru (https://keybase.io/shadowmaru) on keybase.
  • I have a public key whose fingerprint is 16BD 33FB D8C8 541D D751 64D2 4146 8958 61AA 4F17

To claim this, I am signing this object:

'use strict';
angular.module('app')
.directive('my-input', [
function() {
return {
restrict: 'E',
templateUrl: '/my-input.html',
scope: {},
controllerAs: 'myInput',
@shadowmaru
shadowmaru / gist:8796
Created September 4, 2008 15:59
Layout file example
app/views/layouts/application.html.erb
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title><%= @title || "Título" %></title>
<%= stylesheet_link_tag 'site' %>
<%= javascript_include_tag 'application', 'prototype', 'effects' %>
class CreateAuthorizenetGateway < ActiveRecord::Migration
def self.up
login = GatewayOption.create(:name => "login",
:description => "Your Authorize.Net API Login ID")
password = GatewayOption.create(:name => "password",
:description => "Your Authorize.Net Transaction Key.")
test = GatewayOption.create(:name => "test",
:description => "If true, perform transactions against the test server. Otherwise, perform transactions against the production server.")
gateway = Gateway.create(:name => "Authorize.net",
Processing OrdersController#fire (for xxx.xxx.xxx.xxx at 2008-11-19 09:06:43) [PUT]
Session ID: BAh7CjoOcmV0dXJuX3RvMDoMY3NyZl9pZCIlZmI0NGUxYzQxMTY0NWRhNDBh
YWVlZmM2ZmNhYTY3NzI6DHVzZXJfaWRpBiIKZmxhc2hJQzonQWN0aW9uQ29u
dHJvbGxlcjo6Rmxhc2g6OkZsYXNoSGFzaHsABjoKQHVzZWR7ADoNb3JkZXJf
aWQw--8ec59532c83eef92f2e1cdaada63121ecce91fdc
Parameters: {"action"=>"fire", "_method"=>"put", "authenticity_token"=>"f26f6ddcc8db30ba2a504002fb01883e1bfeb4b4", "id"=>"685019094", "e"=>"capture", "controller"=>"admin/orders"}
Gateway Error ...
Redirected to http://xxxxx.com/admin/orders
Completed in 0.65447 (1 reqs/sec) | DB: 0.04395 (6%) | 302 Found [http://xxxxxx.com/admin/orders/685019094/fire?e=capture]
Useful Rails plugins
jrails
paperclip
resource_controller
restful-authentication
restful-authorization
shoulda
tlsmail
ultrasphinx
<% calendar :year => 2009, :month => 1, :events => @events, :field => :happens_on do |date, events| %>
<% for event in events %>
<%= link_to event.name, event_path(event) %>
<% end %>
<% end %>
class ImageModelsController < ApplicationController
before_filter :find_image_model, :only => [:update]
def update
if @image_model.update_attributes(params[:image_model])
@image_model.image.reprocess!
end
end
protected
Letícia: Olá Ricardo, em que posso ajudar ?
Ricardo: Olá, fiz um pedido no dia 2/7 e até hoje ele está em ´análise´
Ricardo: O número do pedido é XXXXX
Letícia : Sr.,infelizmente houve um erro no sistema,
sob o qual seu pedido se encontra. Pedimos
desculpas pelo transtorno, mas caso ainda
deseje adquirir este produto,pedimos para
#
# Generates the migration and opens it in TextMate
#
# ex.:
# mig AddNewColumnToModel new_column:integer
#
function mig {
mate `script/generate migration $@ | tail -n1 | sed 's/.*create //'`
}