This file contains 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 'openssl' | |
require 'fileutils' | |
require 'acme-client' | |
require 'byebug' | |
ENV['SSL_ADDR'] = '2804.7f3.8481.3cf7.x.4.ip6.name' | |
ENV['APPLICATION_ENV'] = 'development' | |
puts 'Registering client' |
This file contains 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
" Load Pathogen | |
execute pathogen#infect() | |
" Use Vim settings, rather then Vi settings (much better!). | |
set nocompatible | |
" Default configuration in case there's no other definition in ftplugin | |
set expandtab | |
set tabstop=2 | |
set softtabstop=2 | |
set shiftwidth=2 |
This file contains 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
a = [ {x: 'Abril/17', y: 10}, {x: 'Abril/17', y: 5}, {x: 'Abril/17', y: 2}, {x: 'Dezembro/17', y: 12}, ] | |
luiz = a.group_by{ |hash| hash[:x] }.map do |k,v| | |
{:x => k, :y => v.map{ |hash| hash[:y] }.inject(:+)} | |
end |
This file contains 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 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 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 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 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
#include<iostream> | |
using namespace std; | |
int main(){ | |
int entrada; | |
bool check = false; | |
cin >> entrada; |
This file contains 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 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 |