This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| find -name ".svn" | while read line; do rm -Rf $line; done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Methods added to this helper will be available to all templates in the application. | |
| module ApplicationHelper | |
| # Helper to render a partial with or without a block. | |
| def render_a_partial(partial_name, options = {}, &block) | |
| if block_given? | |
| options.merge!(:body => capture(&block)) | |
| concat(render(:partial => partial_name, :locals => options), block.binding) | |
| else | |
| render(:partial => partial_name, :locals => options) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for i in `find . -type f -name "*" | grep -v "*.jar"`; do echo $i | tee -a log.txt; cat $i | sed s/textoAntigo/textoNovo/g > x; cat x > $i; rm x; done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| rm -rf `find . -name ".svn"` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'sinatra-rack_app' | |
| run Sinatra::Application |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| list_to_term(String) -> | |
| {ok, T, _} = erl_scan:string(String ++ "."), | |
| case erl_parse:parse_term(T) of | |
| {ok, Term} -> | |
| Term; | |
| {error, Error} -> | |
| Error | |
| end. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Do you want to try it? | |
| --- | |
| 1st. Compile | |
| $ erlc gen_event_manager.erl my_event_manager.erl my_event.erl | |
| 2nd. Test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| %% finite state machine | |
| -module(simples_fsm). | |
| -behaviour(gen_fsm). | |
| -export([start_link/1, dispara_evento/1]). | |
| -export([init/1]). | |
| -export([estado_um/2, estado_dois/2, estado_tres/2]). | |
| %% api |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # Some class for example | |
| # | |
| class SomeClass | |
| def a_method | |
| puts '>> a defined method: a_method' | |
| end | |
| end | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * (Código 1) | |
| * | |
| * Anotação @PersistenceUnit sendo usada num Stateful SessionBean para registrar | |
| * um EntityManagerFactory no contexto JNDI sob o nome "persistencia/MaritimoDB", | |
| * tendo como unidade de persistencia "MaritimoDB". | |
| */ | |
| @Stateful | |
| @PersistenceUnit(name="persistencia/MaritimoDB", unitName="MaritimoDB") | |
| public class AgenteDeTurismoBean implements AgenteDeTurismoRemote { |
OlderNewer