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
def parse_wads(wads, content = {}) | |
unless wads.empty? | |
wads.each_with_index do |item, index| | |
if item['text'] | |
scan = item['text'].gsub('\\n', '\n').match(/(?:\s|^)(\S+)@$/m) | |
if scan && wads[index + 1] | |
text = wads[index + 1]['text'] | |
content[:email] = scan.to_s.strip.downcase | |
content[:email] << text if text | |
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
class Foo | |
def self.bar | |
puts "nao precisa de self" | |
end | |
def self.ble | |
bar | |
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
class ApplicationRecord < ActiveRecord::Base | |
self.abstract_class = true | |
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
<form name="form" ng-submit="vm.submitForm(vm.customer)" class="form-horizontal" novalidate> | |
<div class="panel panel-default"> | |
<div class="panel-header"> | |
<h2 class="panel-heading"> | |
<span ng-if="!vm.customer.id">Adição de Cliente</span> | |
<span ng-if="vm.customer.id">Edição de Cliente</span> | |
</h2> | |
</div> | |
<div class="panel-body"> | |
<fieldset> |
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
# set your user tokens as environment variables, such as ~/.secrets | |
# See the README for examples. | |
[color] | |
ui = true | |
[color "branch"] | |
current = yellow reverse | |
local = yellow | |
remote = green | |
[color "diff"] | |
meta = yellow bold |
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 'net/http' | |
require 'time' | |
@response = Net::HTTP.get_response(URI('https://about.gitlab.com')) | |
puts "Response:" | |
puts @response.header.to_hash | |
def response | |
@response = Net::HTTP.get_response(URI('https://about.gitlab.com')) | |
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
require 'oauth' | |
require 'httpclient' | |
require 'json' | |
class SimpleTwitter | |
def initialize(config) | |
@config = config | |
@http_client = HTTPClient.new | |
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
module Foo | |
def self.included base | |
base.send :include, InstanceMethods | |
base.extend ClassMethods | |
end | |
module InstanceMethods | |
def bar1 | |
'bar1' | |
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
module Foo | |
def self.included base | |
base.extend ClassMethods | |
end | |
module ClassMethods | |
def bar2 | |
puts 'bar2' | |
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
############################ | |
# _ | |
# | |_ _ __ ___ _ ___ __ | |
# | __| '_ ` _ \| | | \ \/ / | |
# | |_| | | | | | |_| |> < | |
# \__|_| |_| |_|\__,_/_/\_\ | |
# | |
############################# | |
# | |
# COPY AND PASTE |