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
# frozen_string_literal: true | |
class PDFSnapshotComparator | |
def initialize(generated) | |
@generated = generated | |
end | |
def same?(expectation) | |
out1 = Tempfile.new(['', '.png']) | |
out2 = Tempfile.new(['', '.png']) |
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 | |
# remove exited containers: | |
docker ps --filter status=dead --filter status=exited -aq | xargs -r docker rm -v | |
# remove unused images: | |
docker images --no-trunc | grep '<none>' | awk '{ print $3 }' | xargs -r docker rmi | |
# remove unused volumes: | |
sudo find '/var/lib/docker/volumes/' -mindepth 1 -maxdepth 1 -type d | grep -vFf <( |
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
$ time terraform apply -var-file=terraform-private.tfvars -var-file=terraform.tfvars | |
... | |
real 3m35,256s | |
user 0m3,221s | |
sys 0m1,241s | |
$ time terraform destroy -var-file=terraform-private.tfvars -var-file=terraform.tfvars | |
real 4m25,263s | |
user 0m3,484s | |
sys 0m1,152s |
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
/** | |
* Filters sensitive data from Angular's $http responses. | |
* | |
* @author Gabriel Teles <gab.teles@hotmail.com> | |
* @version 0.1.0 | |
* @since 2015.12.10 | |
*/ | |
(function() { | |
'use strict'; |
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
# Implementação pela fórmula | |
class << Math | |
FiveSquareRoot = Math.sqrt(5) | |
GoldenRatio = (1 + FiveSquareRoot) / 2 | |
def fibonacci(n) | |
((GoldenRatio ** n - ((-GoldenRatio) ** (-n))) / FiveSquareRoot).round | |
end | |
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
class Array | |
def combsort!(shrink = 1.247330950103979) | |
gap = size | |
swapped = false | |
until gap == 1 and !swapped | |
gap = (gap / shrink).to_i | |
gap = 1 if gap < 1 | |
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
module Kernel | |
def cfor(init, condition, inc) | |
while condition.() | |
yield | |
inc.() | |
end | |
end | |
end | |
if ($0 == __FILE__) |
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
# encoding: utf-8 | |
# @file : Main.rb | |
# @desc : Omni RGSSx Player | |
# @author : Gab! | |
# @history : 2014/04/04 | |
# Requires | |
require 'fiddle' | |
require 'fiddle/struct' | |
require 'fiddle/types' |
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
/* | |
* Konami Code jQuery Plugin | |
* | |
* Usage: | |
* | |
* 1 - Set permanent callback: everytime the user makes the | |
* konami code the callback will | |
* be called. | |
* | |
* $(document).konamiCode(callback, true) |
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
# Interpretador de Brainfuck V2 | |
# Autor: Gabriel Teles <gab.teles@hotmail.com> | |
require 'io/console' # Necessário para usar STDIN.getch | |
module Brainfuck2 | |
# Classe de controle | |
class ProgramData | |
attr_reader :bufferSize, :buffer, :stack, :commands, :position | |
NewerOlder