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
ActiveSupport::Inflector.inflections do |inflect| | |
inflect.plural /ao$/i, 'oes' | |
inflect.singular /oes$/i, 'ao' | |
inflect.plural /l$/i, 'is' | |
inflect.singular /is$/i, 'l' | |
inflect.plural /or$/i, 'ores' | |
inflect.singular /ores$/i, 'or' | |
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
# Print a label on a Zebra TLP 2844 in Ruby. | |
# The printer is EPL/2 capable and connected via USB. | |
# EPL/2 reference: http://www.zebra.com/apps/dlmanager?dlp=-227178c9720c025483893483886ea54a70963bb77ca94fcc1d65ce9394326ed960e43d023beba35831d5d9bfc1740296347157b5024977a&c=gb&l=en | |
# https://github.com/larskanis/libusb | |
require 'libusb' | |
# Select the printer by vendor ID and product ID. | |
# To get a list of connected devices, use 'lsusb'. | |
# 0a5f:0x000a identifies the Zebra TLP 2844. |
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
# Retorna dados sobre o pregão | |
http://www.bmfbovespa.com.br/Pregao-Online/ExecutaAcaoCarregarDados.asp?CodDado=IBOV,ticker&CA=undefined | |
# Retorna ações e seus últimos valores negociados | |
http://www.bmfbovespa.com.br/Pregao-OnLine/ExecutaAcaoCarregarDados.asp?CodDado=Ticker | |
# Retorna o histórico do dia de um papel | |
http://www.bmfbovespa.com.br/Pregao-Online/ExecutaAcaoCarregarDadosPapeis.asp?CodDado=petr4 | |
# Retorna dados de um papel |
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
#!/bin/bash | |
set -e | |
function cleanup() { | |
# clean up our temp folder | |
rm -rf "${TMPDIR}" | |
} | |
trap cleanup EXIT |
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
package main | |
// mentioned in bleve google group | |
// https://groups.google.com/forum/#!topic/bleve/-5Q6W3oBizY | |
import ( | |
"encoding/json" | |
"fmt" | |
"github.com/blevesearch/bleve" | |
"github.com/blevesearch/bleve/document" |
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
var app = require('app'); // Module to control application life. | |
var BrowserWindow = require('browser-window'); // Module to create native browser window. | |
var loki = require('lokijs'), | |
db = new loki(), | |
users = db.addCollection('users', { | |
indices: ['username'] | |
}); | |
users.insert({ username: 'joe', age: 40}); | |
users.insert({ username: 'jack', age: 30}); |
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
// Package GinHTMLRender provides some sugar for gin's template rendering | |
// | |
// This work is based on gin contribs multitemplate render https://github.com/gin-gonic/contrib/blob/master/renders/multitemplate | |
// | |
// Usage | |
// | |
// router := gin.Default() | |
// | |
// // Set html render options | |
// htmlRender := GinHTMLRender.New() |
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
# Ensure you have brew cask installed http://caskroom.io | |
brew install caskroom/cask/brew-cask | |
# Install Docker Toolbox (this will install docker machine and virtualbox) | |
brew cask install dockertoolbox | |
# Create a linux machine for docker container to run on | |
docker-machine create --driver virtualbox default | |
# Add ENV variables for the machine to your profile (and restart your terminal) |
OlderNewer