Skip to content

Instantly share code, notes, and snippets.

View igorlima's full-sized avatar
:octocat:
I may be slow to respond.

Igor Ribeiro Lima igorlima

:octocat:
I may be slow to respond.
View GitHub Profile
@yegappan
yegappan / VimScriptForPythonDevelopers.MD
Last active September 29, 2024 19:06
Vim script for Python Developers

Vim Script for Python Developers

This is a guide to Vim Script development for Python developers. Sample code for the various expressions, statements, functions and programming constructs is shown in both Python and Vim Script. This is not intended to be a tutorial for developing Vim scripts. It is assumed that the reader is familiar with Python programming.

For an introduction to Vim Script development, refer to usr_41.txt, eval.txt and Learn Vimscript the Hard Way

For a guide similar to this one for JavaScript developers, refer to Vim Script for the JavaScripter

This guide only describes the programming constructs that are present in both Python and Vim. The constructs that are unique to Vim (e.g. autocommands, [key-mapping](https://vimhelp.org/map.txt.html#key-m

@JamieMason
JamieMason / .babelrc
Created December 5, 2016 08:41
Tree-Shaking with Babel 6, Webpack 2, and React.
{
"presets": [
["es2015", {
"es2015": {
"loose": true,
"modules": false
}
}], "react"
]
}
@pmuellr
pmuellr / nsolid-install.sh
Last active January 31, 2021 13:19
sample script to install N|Solid components into ~/nsolid
#!/bin/bash
#-------------------------------------------------------------------------------
# download/unpack componentry for N|Solid into ~/nsolid
#-------------------------------------------------------------------------------
# updates:
# 2016-05-04 print note about officially supported "Download All" tarball
# 2016-02-10 change to get N|Solid versions dynamically from index.tab
# 2016-02-10 upgrade to N|Solid 1.2.1
# 2016-01-12 upgrade to N|Solid 1.2.0
@ourmaninamsterdam
ourmaninamsterdam / LICENSE
Last active November 7, 2024 03:37
Arrayzing - The JavaScript array cheatsheet
The MIT License (MIT)
Copyright (c) 2015 Justin Perry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
@igorlima
igorlima / README.md
Last active August 29, 2015 14:16
JS unit testing using dependency injection

Gittip Donate Button

JS unit testing using dependency injection

You probably know that to do JavaScript testing is good and some hurdles to overcome is how to test our code in a manner to (i) inject mocks for other modules, (ii) to leak private variables or (iii) override variables within the module.

rewire is a tool for helping us on overcoming these hurdles. It provides us an easy way to dependency injection for unit testing and adds a special setter and getter to modules so we can modify their behaviour for better unit testing. What rewire does is to not load the file and eval the contents to emulate the load mechanism.

To get started with dependency injection, we'll create a twitter rest api server and do unit tests using mocks and overriding variables within modules. This e

@igorlima
igorlima / README.md
Last active August 29, 2015 14:16
Get started with Saucie CLI and make easier cross browser testing

Gittip Donate Button

You probably know that to do JavaScript testing is good and one of hurdles to overcome is how to test our code on different browsers. There’re some tools availables for helping us on hurdling this overcome. One of them is a CLI (command line) named saucie developed by igorlima. This CLI is a library hosted on NPM which allows integrate your frontend JavaScript tests with SauceLabs platform. SauceLabs makes awesome cross browser testing, and saucie makes easier that cross browser testing by CLI.

A great interactive JS Test Runner, the testem library, uses saucie on its examples and has the fo

@Ago3t1nho
Ago3t1nho / README.md
Last active August 29, 2015 14:10 — forked from igorlima/README.md

BrowserStack é uma plataforma de teste que possibilita realizar testes automáticos ou manuais em aplicações móveis e web em diversos navegadores, incluindo navegadores como Internet Explorer, Opera, Safari, Android, iPhone, Chrome etc. Plataforma bastante parecida com o SauceLabs, mas infelizmente não possui nenhum plano gratuito, só há um curto período para teste (o suficiente para podermos fazer um pequeno experimento).

Essa plataforma permite executar os testes em diversas linguagem de programação, porém, em nosso exemplo, iremos utilizar o NodeJS (JavaScript) e o Node Package Manager (NPM), que podem ser baixados no site oficial. É necessário o NPM para instalar o Karma, o PhantomJS e o WD, digitando o seguinte script no terminal:

npm install -g cucumber phantomjs

npm install wd

O NodeJS possui dois tipos de de

@igorlima
igorlima / README.md
Last active August 29, 2015 14:03
Artigo Tableless - Gerenciamento de dependências de bibliotecas JavaScript

Gittip Donate Button

Esse artigo é mais um exemplo prático de como gerenciar dependências JS. Para isso vamos utilizar um projeto sem gerenciamento de dependência e aplicar os conhecimentos do artigo publicado no Tableless sobre o Bower. Primeiramente, vamos baixar o projeto:

git clone [email protected]:/69153705256f6a9a4557.git projeto-sem-gerenciamento
cd projeto-sem-gerenciamento

As bibliotecas utilizadas são: Knockout, Zepto, Ratchet JS e Font Awesome. Para gerenciá-las, é preciso criar um arquivo json de configuração.

@igorlima
igorlima / Procfile
Last active September 14, 2017 21:57
Artigo Tableless - Como publicar aplicação NodeJS no Heroku
web: node server.js

A programação assíncrona possui a vantagem de gerar códigos perfomáticos. Em certos casos, a implementação de diversas funções assíncronas encadeadas através de funções callback pode prejudicar a leitura e a manutenção do código. Para demonstrar esse encadeamento, vamos utilizar um trecho de código que utiliza a API do Selenium 2. Baseado em um exemplo do site do SauceLabs.

A API do Selenium WebDriver pode ser utilizada por diversas linguagem de programação, porém, em nosso exemplo, iremos utilizar o NodeJS (JavaScript) e o gerenciador de pacotes NPM, que podem ser baixados no site oficial. O NPM é necessário para instalar o PhantomJS e o WD, utilizando o seguinte script:

npm install -g phantomjs

npm install wd

O NodeJS possui dois tipos de dependências: global ou local. Quando uma dependência é