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
// Define a class for video game consoles | |
class Console { | |
constructor(name, generation, graphics, sound, performance, catalog, aladdin, sonic) { | |
this.name = name; | |
this.generation = generation; | |
this.graphics = graphics; | |
this.sound = sound; | |
this.performance = performance; | |
this.catalog = catalog; | |
this.aladdin = aladdin; |
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
package aoc.day01; | |
import aoc.Day; | |
import java.util.ArrayList; | |
import java.util.List; | |
public class Day04 implements Day { | |
@Override | |
public String part1(List<String> input) { |
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
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 |
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
#!/usr/bin/env kscript | |
//DEPS com.google.photos.library:google-photos-library-client:1.5.0 | |
import com.google.api.gax.core.FixedCredentialsProvider | |
import com.google.api.gax.rpc.ApiException | |
import com.google.auth.oauth2.AccessToken | |
import com.google.auth.oauth2.UserCredentials | |
import com.google.photos.library.v1.PhotosLibraryClient | |
import com.google.photos.library.v1.PhotosLibrarySettings | |
import com.google.photos.library.v1.proto.BatchCreateMediaItemsResponse |
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
#!/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}") |
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
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; | |
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
## Useful Commands | |
Get kubectl version | |
kubectl version | |
Get cluster info: |
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
// More about hash code | |
import java.util.*; | |
import java.lang.*; | |
public class Example | |
{ | |
public int x; | |
public Example(int x) { | |
this.x = x; |
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
#https://ivanmosquera.net/2017/05/15/implication-conditional-equivalence-and-biconditional-nl-and-programming-examples/ | |
def conditional(a,b): | |
if a: | |
return b | |
else: | |
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))) |
NewerOlder