Skip to content

Instantly share code, notes, and snippets.

View toniesteves's full-sized avatar

Toni Esteves toniesteves

View GitHub Profile
app.controller('ModalCtrl', function ($scope, $http, ngDialog, Schedule,$controller) {
$scope.open = function (resourceObj,date) {
$scope.employee = resourceObj.title;
$scope.date = new Date(date);
$scope.time = new Date(date);
ngDialog.open({
template: '/assets/angular/views/modal',
controller: 'ScheduleCtrl',
def create
@archive = Archive.new(archive_params)
@archive.receipt = 0;
options = {:col_sep => "\t", :row_sep => "\n"}
SmarterCSV.process(archive_params[:attachment].path,options) do |chunk|
chunk.each do |data_hash|
@archive.receipt += data_hash[:price]
Order.create!( data_hash )
end
@toniesteves
toniesteves / album_spec.rb
Created March 20, 2017 17:41 — forked from IPrism/album_spec.rb
Example for testing mongoid assocications with Rspec
require 'spec_helper'
describe Album do
before(:all) do
@album = Factory.build(:album)
@website = @album.website
end
it "should be valid" do
@album.should be_valid
end
@toniesteves
toniesteves / alias_matchers.md
Created August 22, 2017 13:51 — forked from JunichiIto/alias_matchers.md
List of alias matchers in RSpec 3

This list is based on aliases_spec.rb.

You can see also Module: RSpec::Matchers API.

matcher aliased to description
a_truthy_value be_truthy a truthy value
a_falsey_value be_falsey a falsey value
be_falsy be_falsey be falsy
a_falsy_value be_falsey a falsy value
[
{
"name": "Imóveis",
"subcategories": [
{
"name": "Apartamentos",
"kinds": [
{
"name": "Padrão"
},
@toniesteves
toniesteves / artists_releases_spec.rb
Created February 11, 2018 00:42 — forked from stuliston/artists_releases_spec.rb
Testing HABTM with rspec and factory girl
require 'spec_helper'
describe "Artists to releases relationship" do
before(:all) do
@kanye = FactoryGirl.create(:artist, :name => 'Kanye West')
@jz = FactoryGirl.create(:artist, :name => 'Jay Z')
@watch_the_throne = FactoryGirl.create(:release, :name => 'Watch the Throne')
@dropout = FactoryGirl.create(:release, :name => 'The College Dropout')
end
version: 2
jobs:
build:
parallelism: 3
docker:
- image: circleci/ruby:2.4-node
environment:
BUNDLE_JOBS: 3
BUNDLE_RETRY: 3
BUNDLE_PATH: vendor/bundle
@toniesteves
toniesteves / data.csv
Last active September 12, 2019 11:29
Calculo1 LPT P1 IC Calculo2 cra
8.7 10 9 9.1 8.4 8.47764705882353
7 7 7.7 7 6.2 6.8517241379310345
8.6 9.8 7.9 9.6 8.7 9.090588235294119
7.8 8.3 6.8 8.2 8 7.283516483516483
5.2 9.3 5 8.5 5 7.205747126436782
6.1 9.2 9.1 9.3 5.6 7.808235294117647
6.3 9.6 8.3 8.6 6.7 8.858823529411765
7.5 8.9 7.5 7.9 5 6.158823529411765
6.6 9 5 7.9 5 6.7305882352941175
{
"volumes":[
{
"DataInformacao":"31/01/1990",
"Fonte":"ANA",
"Volume":"518.39",
"VolumePercentual":96.8
},
{
"DataInformacao":"28/02/1990",
We can't make this file beautiful and searchable because it's too large.
ID,League,Date,HomeTeam,AwayTeam,B365H,B365D,B365A,BWH,BWD,BWA,IWH,IWD,IWA,LBH,LBD,LBA,PSH,PSD,PSA,WHH,WHD,WHA,VCH,VCD,VCA,BbMx>2.5,BbAv>2.5,BbMx<2.5,BbAv<2.5,Year,HS,HST,HF,HC,HY,HR,AS,AST,AF,AC,AY,AR,Result
GER310812#0,Germany,31/08/12,Mainz,Greuther Furth,0.5555555555555556,0.2857142857142857,0.2222222222222222,0.53475935828877,0.2857142857142857,0.2309468822170901,0.5555555555555556,0.29411764705882354,0.25,0.5464480874316939,0.2857142857142857,0.2309468822170901,0.5376344086021505,0.27027027027027023,0.2127659574468085,0.5464480874316939,0.2857142857142857,0.2309468822170901,0.5405405405405405,0.27027027027027023,0.2173913043478261,2.09,1.98,1.94,1.83,2013,[8.0],[3.0],[13.0],[8.0],[2.0],[0.0],[8.0],[3.0],[13.0],[8.0],[2.0],[0.0],0
GER010912#0,Germany,01/09/12,Fortuna Dusseldorf,M'gladbach,0.3448275862068966,0.30303030303030304,0.4166666666666667,0.3333333333333333,0.30303030303030304,0.4347826086956522,0.3448275862068966,0.3225806451612903,0.4347826086956522,0.3333333333333333,0.29411764705882354,0.43478