Instantly share code, notes, and snippets.

# Christian Vasquezchrisvasqm

• Sort options
Created Jun 23, 2018
View MathV2.kt
 class MathV2 { companion object { fun calculate(first: Int, second: Int, callback: (a: Int, b: Int) -> Int) = callback(first, second) } }
Created Jun 23, 2018
View MathV1.kt
 class MathV1 { companion object { fun add(first: Int, second: Int) = first + second fun multiply(multiplicand: Int, multiplier: Int) = multiplicand * multiplier }
Created May 23, 2018
Sample layout to demonstrate how to preserve state after a device has been rotated.
Last active Aug 17, 2019
Reimplementation of the Math class to be used as an example for Unit Testing.
View Math.java
 public final class Math { public static int add(int first, int second) { return firstNumber + secondNumber; } public static int multiply(int multiplicand, int multiplier) { return multiplicand * multiplier; }
Last active Mar 20, 2018
Example of the classic interview exercise known as the FizzBuzz. Which consists on counting all the numbers from 1 to 100, and replace any numbers that are divisible by 3 with the word "Fizz", if it's divisible by 5 replace it with "Buzz", and if it is divisible by both 3 and 5 replace it with "FizzBuzz".
View fizzbuzz.js
 for (let i = 1; i < 100; i++) { if (isFizzBuzz(i)) console.log('FizzBuzz'); else if (isFizz(i)) console.log('Fizz'); else if (isBuzz(i)) console.log('Buzz'); else console.log(i); }
Created Mar 19, 2018
This is an example of a function that takes another function and then invokes it.
View functional-programming.js
 function executeTheOTherFunction(theOtherFunction) { theOtherFunction(); } executeTheOTherFunction(() => console.log('suh dude')); // outputs: suh dude
Created Mar 11, 2018
Convierte numeros enteros y decimales a palabras y las imprime en consola.
View NumberoALetra.java
 package com.example; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class NumeroALetra { private static int flag = 0; private static String num; private static String num_letra;
Last active Mar 20, 2018
The goal is to design and create the structure of a ReportCard Java Class which would allow a school to store a student’s grades for a particular year.
View Main.kt