Skip to content

Instantly share code, notes, and snippets.

Christian Vasquez chrisvasqm

Block or report user

Report or block chrisvasqm

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View MathV2.kt
class MathV2 {
companion object {
fun calculate(first: Int, second: Int, callback: (a: Int, b: Int) -> Int) =
callback(first, second)
View MathV1.kt
class MathV1 {
companion object {
fun add(first: Int, second: Int) = first + second
fun multiply(multiplicand: Int, multiplier: Int) = multiplicand * multiplier
chrisvasqm / orientation_change_layout.xml
Created May 23, 2018
Sample layout to demonstrate how to preserve state after a device has been rotated.
View orientation_change_layout.xml
<?xml version="1.0" encoding="utf-8"?>
< xmlns:android=""
chrisvasqm /
Last active Oct 13, 2019
Reimplementation of the Math class to be used as an example for Unit Testing.
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;
chrisvasqm / fizzbuzz.js
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))
else if (isFizz(i))
else if (isBuzz(i))
chrisvasqm / functional-programming.js
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) {
executeTheOTherFunction(() => console.log('suh dude')); // outputs: suh dude
chrisvasqm /
Created Mar 11, 2018
Convierte numeros enteros y decimales a palabras y las imprime en consola.
package com.example;
public class NumeroALetra {
private static int flag = 0;
private static String num;
private static String num_letra;
chrisvasqm / Main.kt
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
fun main(args: Array<String>) {
val student = ReportCard("Chris")
student.apply {
biologyGrade = "A"
historyGrade = "B"
mathGrade = "B"
println(student) // ReportCard(studentName=Chris, historyGrade=B, mathGrade=B, biologyGrade=A)
chrisvasqm / sum-all-argument.js
Created Jan 1, 2018
Example of how to create a function that can sum any amount of numbers you pass in by using the "arguments" object that every non-arrow function has by default in JavaScript
View sum-all-argument.js
console.log("Result: " + sum(2, 2, 2, 2, 2, 2))
function sum() {
let result = 0
const args = Array.from(arguments)
args.forEach(element => {
result += element
You can’t perform that action at this time.