Skip to content

Instantly share code, notes, and snippets.

View efecarranza's full-sized avatar
🤪

Fermin 'Piscu' Carranza efecarranza

🤪
View GitHub Profile
function testManaTransferFrom() public {
address mana = collectorContract.MANA();
(uint256 initialQty, , , , , ) = collectorContract.assets(mana);
console.log(MANAToken(mana).balanceOf(AaveV2Ethereum.COLLECTOR));
console.log("allowance before");
console.log(MANAToken(mana).allowance(AaveV2Ethereum.COLLECTOR, address(this)));
vm.prank(AaveV2Ethereum.COLLECTOR);
class ComputerGuess
def play
possible_digits = [0,1,2,3,4,5,6,7,8,9]
good_digits = []
bad_digits = []
playing = true
while playing
initial_guess = generate_number(possible_digits)
clues = get_clues(initial_guess)
running = did_we_guess?(clues)
class HumanGuessing
def play:
guessme = get_number_to_guess
until endgame
guess = get_user_guess
if !valid?(guess)
# Ask user to guess again
else
check_versus_generated_number(guessme, guess)
import random
MAX_TEAMS = 5
back_end = ['Evan Reisman', 'Cort Lyons', 'Rogerio da Silva', 'Bruno Coelho', 'Alireza Golkar', 'Rodrigo Quaresma',
'Dimitri Vassiliev', 'Ozan Ackin', 'Josh Brickner', 'Benjamin Matthews']
front_end = ['Paul Parker', 'Noah Drabinsky', 'Balinder Singh', 'Mohammed Alsaid', 'Pouya Sanoeei', 'Angel Garbarino']
qa = ['Jacek Adamczyk', 'Greg McAlpine', 'Justin Siples', 'Warren Tom', 'Paul Ripley', 'Maria Luisa Chau', 'Anna Prokofyev']
@efecarranza
efecarranza / Fibs
Created April 17, 2015 17:30
Interque Question - Fibonacci Code
def fibs(n)
first_fib = 1
second_fib = 1
result = [first_fib, second_fib]
if n < 1
return "Please enter a valid number, it has to be greater than or equal to 1."
end
while second_fib < n
@efecarranza
efecarranza / gist:54d4c5669fef4b3cbf3d
Created February 6, 2015 16:39
All In One - Input Validation jQuery work
CSS file
.error {
color: red;
}
JavaScript/jQuery file
$(function() {
@efecarranza
efecarranza / gist:264d9f33c324a1b2a7ba
Created January 21, 2015 01:48
Wyncode Methods 2
# Author: piscu Carranza
# January 19, 2015
# Week Two - Wyncode
# Profile
module WyncodeMethods
# Problems With Floats
puts "Here's a calculator to give the check with tip included."
@efecarranza
efecarranza / gist:5803c16086ff9ea8b95e
Created January 19, 2015 21:12
wyncode_methods.rb
# Author: piscu Carranza
# January 19, 2015
# Week Two - Wyncode
# Profile
# Problems With Floats
puts <<END
Using floats can be a pain. Therefore,
here is an idea on how to make sure no
@efecarranza
efecarranza / wyncode.rb
Created January 14, 2015 03:35
First Week Coding Ruby
#Profile
# Problems With Floats
puts <<END
Using floats can be a pain. Therefore,
here is an idea on how to make sure no
random digits are added (stupid binary!).
END