Skip to content

Instantly share code, notes, and snippets.

@willmendesneto
willmendesneto / solarized-dark.css
Created January 4, 2015 22:13
Solarized Dark highlight for Jekyll blogs/websites
/* Solarized Dark
For use with Jekyll and Pygments
http://ethanschoonover.com/solarized
SOLARIZED HEX ROLE
--------- -------- ------------------------------------------
base03 #002b36 background
base01 #586e75 comments / secondary content
@willmendesneto
willmendesneto / .aliases
Created February 13, 2015 21:06
.aliases
################################################################################
# Default Aliases
################################################################################
# Easier navigation: .., ..., ...., ....., ~ and -
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
@willmendesneto
willmendesneto / .functions
Last active August 29, 2015 14:15
.functions
# Simple calculator
function calc() {
local result="";
result="$(printf "scale=10;$*\n" | bc --mathlib | tr -d '\\\n')";
# └─ default (when `--mathlib` is used) is 20
#
if [[ "$result" == *.* ]]; then
# improve the output for decimal numbers
printf "$result" |
sed -e 's/^\./0./' `# add "0" for cases like ".5"` \
@willmendesneto
willmendesneto / protractor_conf.js
Created February 15, 2015 12:26
An example of protractor configuration
// An example configuration file.
exports.config = {
// Do not start a Selenium Standalone sever - only run this using chrome.
chromeOnly: true,
chromeDriver: './node_modules/protractor/selenium/chromedriver',
seleniumAddress: 'http://0.0.0.0:4444/wd/hub',
baseUrl: 'http://0.0.0.0:9000',
// Capabilities to be passed to the webdriver instance.
@willmendesneto
willmendesneto / gist:196f84c884cf501dfced
Created March 19, 2015 17:58
AngularJS: testing form validation
// In your controller

this.item = {
    userType: ''
};
<!-- In your html template -->
@willmendesneto
willmendesneto / gist:342d4f286bacaa541934
Last active August 29, 2015 14:19
Angular Modules Third-Party

Angular Modules Third-party

A list of angular modules (work in progress EVER)

Forms

Masks

Tags

@willmendesneto
willmendesneto / protractor.conf.js
Created June 21, 2015 15:43
Protractor snapshot UI tests configuration using Jasmine
'use strict';
var ScreenshotReporter = require('./screenshots.js');
var path = require('path');
exports.config = {
seleniumAddress: 'http://0.0.0.0:4444/wd/hub',
// Do not start a Selenium Standalone sever - only run this using chrome.
chromeOnly: true,
chromeDriver: '../../node_modules/protractor/selenium/chromedriver',
@willmendesneto
willmendesneto / basic-auth-multiple-credentials.js
Last active September 7, 2015 15:46
Multiple credentials check with Basic Auth node package
'use strict';
/**
* Multiple credentials check with Basic Auth node package
*
* How to use (ExpresJS example):
*
* var BASIC_AUTH = [
* {
* name: process.env.BASIC_AUTH_USERNAME,
@willmendesneto
willmendesneto / index.js
Last active November 1, 2015 05:35
Build checker: Application using Arduino + Johnny Five + NodeJS for to monitor build/deploy status in your Continuos Integration server
var request = require('request');
var five = require('johnny-five');
var board = new five.Board();
var CONFIG = {
LED: {
SUCCESS: 12,
ERROR: 10
},
CI_CCTRACKER_URL: 'https://snap-ci.com/willmendesneto/generator-reactor/branch/master/cctray.xml',
@willmendesneto
willmendesneto / read-files-in-dir.sh
Created March 23, 2016 11:02
Shell: reading files in a specific directory
# Load ".cli" folder content
if [ -d ~/.cli ]; then
CLI_FILES=$(find ~/.cli -maxdepth 2 -type f)
while read -r line; do
source $line
done <<< "$CLI_FILES"
fi