Skip to content

Instantly share code, notes, and snippets.

View harlley's full-sized avatar
👨‍💻
Stay focused and keep shipping

Harlley Oliveira harlley

👨‍💻
Stay focused and keep shipping
View GitHub Profile
@harlley
harlley / index.js
Last active December 17, 2019 10:00
opa
#!/usr/bin/env node
console.log('opa :D');
SELECT endereco from CLIENTES where NOME = 'Marty Mcfly';
SELECT * from CLIENTES;
@harlley
harlley / utm_tracking
Created September 25, 2016 18:08 — forked from devinsays/utm_tracking
Small jQuery plugin to add UTM tracking to links in an element.
jQuery.fn.utm_tracking = function(domain, source, medium, campaign) {
$(this).find('a[href^="' + domain + '"]').each(function() {
var url = $(this).attr('href');
$(this).attr( 'href', url + '?utm_source=' + source + '&utm_medium=' + medium + '&utm_campaign=' + campaign );
});
}
// Example Call
$(document).ready( function() {
$('body').utm_tracking('http://www.example.com','example_source','example_link','example_campaign');
@harlley
harlley / index.html
Created June 29, 2016 03:19 — forked from anonymous/index.html
teste
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Document</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0/jquery.min.js"></script>
</head>
<body>
<h1>Opa</h1>
@harlley
harlley / utm_infusion.html
Created April 8, 2016 20:28
utm infusion
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script>
function getUrlParameter(sParam) {
var sPageURL = window.location.search.substring(1);
var sURLVariables = sPageURL.split('&');
for (var i = 0; i < sURLVariables.length; i++)
{
var sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] == sParam)
@harlley
harlley / botao.js
Last active January 16, 2016 22:30
Captura o utm_source da URL e coloca no botão indicado pela classe CSS
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
jQuery(document).ready(function($){
/*** TROQUE O VALOR suaclasse PELA CLASSE CSS DO SEU BOTÃO ***/
var SEU_BOTAO = "suaclasse";
/****************************/
SEU_BOTAO = "." + SEU_BOTAO;
function getUrlParameter(sParam) {
@harlley
harlley / vaga-dev-ng-ror-bh.md
Last active August 29, 2015 14:07
Beved contrata Desenvolvedor Web com Sólida Experiência em AngularJS + Ruby on Rails

Sobre a vaga

Estamos procurando um Desenvolvedor Web que tenha 2+ anos de experência desenvolvendo aplicações SPA com AngularJS no frontend e API Rest escrita em Ruby on Rails no backend.

Sobre o Beved

Somos uma startup no seguimento de educação. Estamos no mercado desde 2012 e chegamos no momento de escalar o negócio para atender centenas de milhares de usuários → www.beved.com.br

Pré-requisitos

  • 2+ anos de experência com AngularJS
@harlley
harlley / dbranch.rb
Last active August 29, 2015 13:59
Delete local and remote branchs
branchs = %w( v2.0.1 v2.0.2 v2.0.11 v2.1 )
branchs.each do |branch|
system("git push origin :#{branch} && git branch -D #{branch}")
end
@harlley
harlley / jasmine.md
Created January 16, 2014 17:13 — forked from froots/jasmine.md

##Introduction

One definition of unit testing is the process of taking the smallest piece of testable code in an application, isolating it from the remainder of your codebase and determining if it behaves exactly as expected. In this section, we'll be taking a look at how to unit test Backbone applications using a popular JavaScript testing framework called Jasmine.

For an application to be considered 'well'-tested, distinct functionality should ideally have its own separate unit tests where it's tested against the different conditions you expect it to work under. All tests must pass before functionality is considered 'complete'. This allows developers to both modify a unit of code and it's dependencies with a level of confidence about whether these changes have caused any breakage.

As a basic example of unit testing is where a developer may wish to assert whether passing specific values through to a sum function results in the correct output being returned. For an example more relevant to this book,