Skip to content

Instantly share code, notes, and snippets.

View ivmos's full-sized avatar
Hey there I’m using Github

Iván Mosquera ivmos

Hey there I’m using Github
View GitHub Profile
// Define a class for video game consoles
class Console {
constructor(name, generation, graphics, sound, performance, catalog, aladdin, sonic) { = name;
this.generation = generation; = graphics;
this.sound = sound;
this.performance = performance;
this.catalog = catalog;
this.aladdin = aladdin;
ivmos /
Last active December 4, 2022 09:37
AOC2022 Day04 implemented with ChatGPT
package aoc.day01;
import aoc.Day;
import java.util.ArrayList;
import java.util.List;
public class Day04 implements Day {
public String part1(List<String> input) {
ivmos / CustomLocalValidatorFactoryBean.kt
Created February 18, 2022 22:56 — forked from pschichtel/CustomLocalValidatorFactoryBean.kt
import org.hibernate.validator.internal.engine.DefaultClockProvider
import org.springframework.core.LocalVariableTableParameterNameDiscoverer
import org.springframework.core.PrioritizedParameterNameDiscoverer
import org.springframework.core.StandardReflectionParameterNameDiscoverer
import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean
import java.lang.reflect.Constructor
import java.lang.reflect.Method
import javax.validation.ClockProvider
import javax.validation.Configuration
import javax.validation.ParameterNameProvider
#!/usr/bin/env kscript
#!/usr/bin/env kscript
// This is a handy template for writing quick kotlin scripts.
// What the script does <TODO>
import kotlin.system.exitProcess
class AnsiColors { companion object { const val ANSI_RESET = "\u001B[0m"; const val ANSI_RED = "\u001B[31m"; const val ANSI_GREEN = "\u001B[32m"; const val ANSI_YELLOW = "\u001B[33m"; const val ANSI_BLUE = "\u001B[34m"; const val ANSI_PURPLE = "\u001B[35m"; const val ANSI_CYAN = "\u001B[36m"; const val ANSI_WHITE = "\u001B[37m"; } }
fun logInfo(message: String) = println("${AnsiColors.ANSI_BLUE}$message${AnsiColors.ANSI_RESET}")
fun logWarn(message: String) = println("${AnsiColors.ANSI_YELLOW}$message${AnsiColors.ANSI_RESET}")
import React, { Component } from 'react';
import { TouchableOpacity, TouchableHighlight } from 'react-native';
import { PropTypes } from 'prop-types';
/* eslint-disable no-invalid-this */
const debounce = function(callback, wait, context = this)
let timeout = null;
let callbackArgs = null;
## Useful Commands
Get kubectl version
kubectl version
Get cluster info:
// More about hash code
import java.util.*;
import java.lang.*;
public class Example
public int x;
public Example(int x) {
this.x = x;
def conditional(a,b):
if a:
return b
return True
print("\tp\tq\tp =>q")
for p in (True, False):
for q in (True, False):
print("%10s %10s %s" %(p,q, conditional(p, q)))