Skip to content

Instantly share code, notes, and snippets.

View leonardoeloy's full-sized avatar

Leonardo Eloy leonardoeloy

View GitHub Profile
@leonardoeloy
leonardoeloy / Example1.cs
Created July 9, 2012 12:06
Multiple browsers tests with Webinator - Not pretty, but effective.
namespace Test
{
class UnitTest
{
private static MultipleBrowsers _multipleBrowsers;
[ClassInitialize]
public static void ClassInitialize(TestContext context)
{
_multipleBrowsers = new MultipleBrowsers();
@leonardoeloy
leonardoeloy / Authentication.feature
Created July 12, 2012 19:25
Multiple browsers tests with Webinator, SpecFlow and NUnit
Feature: Authentication
In order to SOMETHING
As SOMEONE
I want to SOMETHING
Scenario: Registering with a valid e-mail
Given I am on the registration page
When I fill the "E-Mail" field with "[email protected]"
And I click "OK"
Then I should be on the confirmation page
@leonardoeloy
leonardoeloy / create_issue_from_note_gitlab.patch
Created September 26, 2012 12:08
Create issue from note in Gitlab
--- gitlabhq_original/app/controllers/notes_controller.rb 2012-09-26 08:58:50.000000000 -0300
+++ gitlabhq/app/controllers/notes_controller.rb 2012-09-26 08:35:35.000000000 -0300
@@ -17,6 +17,17 @@
def create
@note = Notes::CreateContext.new(project, current_user, params).execute
+ if not params[:create_issue].nil?
+ issue_params = {
+ :title => params[:note][:note][0..40] + "...",
+ :description => "#{params[:note][:note]} \n\nNote %#{@note.id}",
@leonardoeloy
leonardoeloy / gist:5691141
Last active December 17, 2015 23:39
O_O!
static inline unsigned short fe_ip_checksum(unsigned char *iph, unsigned int ihl) {
unsigned int soma;
asm volatile(
"movl (%1), %0" \
"subl $4, %2" \
"jbe 2f" \
"addl 4(%1), %0" \
"adcl 8(%1), %0" \
"adcl 12(%1), %0" \
@leonardoeloy
leonardoeloy / reasons_to_use_ci_cd.md
Last active November 6, 2018 12:46
Reasons to use CI/CD

Reasons to use CI/CD

Recently, I've been asked by a group of people to provide arguments that should convince developers and managers to use a CI/CD infrastructure. If you're a developer and you haven't been frozen in an icy lake somewhere in Greenland for the past 8-10 years, you don't need to be convinced. Please, move on. You'll only read what you're used to do daily. And to thank you for stopping by, here's a nice photo of a dog:

We all don't

So, if you're still here, it means you're in doubt of how CI/CD will play a role in our software development utility belt. Although we all know that automated tests and even a simple CI/CD infrastructure are the foundation of modern software development practices, I wasn't able to answer their questions right on spot. I mean, it's obvious that what we do has benefits, but we still don't know how to quantify them. Often, we see folks banging their heads against the wall trying to figure out _wh

@leonardoeloy
leonardoeloy / gist:6088412
Created July 26, 2013 12:11
People who bother...
perl -e "foreach my \$i (1..20) {print \$i. ' job Jenkins ';print 'incomoda ' x \$i;if(\$i%2==0){print \"muito mais\n\";}else{print \"muita gente\n\";}}"

Webstorm and JSX

@leonardoeloy
leonardoeloy / multilogger.rb
Last active August 29, 2015 14:27
MultiLogger with Ruby
module Whatever
class MultiLogger
def initialize(*loggers)
@loggers = loggers
end
def method_missing(method, *args, &block)
@loggers.each do |logger|
logger_method = logger.method(method)
logger_method.call *args, &block
https://medium.com/@IndianGuru/best-practices-for-a-new-go-developer-8660384302fc
http://golang.org/doc/code.html
http://mwholt.blogspot.in/2014/08/maximizing-use-of-interfaces-in-go.html
http://talks.golang.org/2012/splash.article
http://blog.golang.org/concurrency-is-not-parallelism
https://github.com/feyeleanor/GoSpeed
@leonardoeloy
leonardoeloy / metrics-template.json
Created April 17, 2018 00:27 — forked from tegud/metrics-template.json
Template for using Elasticsearch as a Time Series Database
{
"metrics" : {
"order" : 0,
"template" : "metrics-*",
"settings" : {
"index" : {
"refresh_interval" : "5s"
}
},
"mappings" : {