This file contains hidden or 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
#!/bin/bash | |
keytool -list -printcert -jarfile $1 |
This file contains hidden or 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 net.daverix.util | |
import androidx.fragment.app.FragmentActivity | |
import androidx.lifecycle.ViewModel | |
import androidx.lifecycle.ViewModelProvider | |
import androidx.lifecycle.ViewModelProviders | |
inline fun <reified T : ViewModel> FragmentActivity.getViewModel(crossinline factory: ()->T): T { | |
return ViewModelProviders.of(this, object : ViewModelProvider.Factory { | |
@Suppress("UNCHECKED_CAST") |
This file contains hidden or 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 net.daverix.mock | |
import com.google.common.truth.Truth.assertThat | |
import net.daverix.transparentcalendarwidget.db.EventsProvider | |
import net.daverix.transparentcalendarwidget.model.CalendarEvent | |
import org.junit.Test | |
import java.lang.reflect.InvocationHandler | |
import java.lang.reflect.Method | |
import java.lang.reflect.Proxy |
This file contains hidden or 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
fun String.fromCamelCaseToScreamingSnakeCase(): String { | |
val builder = StringBuilder() | |
for(i in 0 until length) { | |
if(i > 0 && i < length-1 && this[i].isUpperCase()) | |
builder.append("_") | |
builder.append(this[i].toUpperCase()) | |
} | |
return builder.toString() | |
} |
This file contains hidden or 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
<?php | |
function loadDocument($url) { | |
$pageContent = file_get_contents($url); | |
$document = new DOMDocument(); | |
$document->loadHtml($pageContent); | |
return $document; | |
} | |
if($_SERVER['REQUEST_METHOD'] == 'POST') { | |
$restaurants['af'] = function($weekday) { |
This file contains hidden or 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
final int limit = buffer.limit(); | |
final int pixels = limit / 4; | |
long red = 0; | |
long green = 0; | |
long blue = 0; | |
for(int i=0;i<limit;i+=4) { | |
int color = buffer.getInt(i); | |
red += 0xFF & color; | |
green += 0x00FF & (color >> 8); |
This file contains hidden or 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
namespace AdventOfCode { | |
public class Day1Test { | |
[Test] | |
public void SolveSanta1() | |
{ | |
const string puzzle = | |
"((((()(()(((((((()))(((()((((()())(())()(((()((((((()((()(()(((()(()((())))()((()()())))))))))()((((((())((()))(((((()(((((((((()()))((()(())()((())((()(()))((()))()))()(((((()(((()()))()())((()((((())()())()((((())()(()(()(((()(())(()(())(((((((())()()(((())(()(()(()(())))(()((((())((()))(((()(()()(((((()()(()(((()(((((())()))()((()(()))()((()((((())((((())(()(((())()()(()()()()()(())((((())((())(()()))()((((())))((((()())()((((())((()())((())(())(((((()((((()(((()((((())(()(((()()))()))((((((()((())()())))(((()(()))(()()(()(((()(()))((()()()())((()()()(((())())()())())())((()))(()(()))(((((()(()(())((()(())(())()((((()())()))((((())(())((())())((((()(((())(())((()()((((()((((((()(())()()(()(()()((((()))(())()())()))(())))(())))())()()(())(()))()((()(()(())()()))(()())))))(()))(()()))(())(((((()(()(()()((())()())))))((())())((())(()(())((()))(())(( |
This file contains hidden or 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 com.example; | |
import javax.inject.Scope; | |
import javax.inject.Singleton; | |
import dagger.Component; | |
import dagger.Module; | |
import dagger.Provides; | |
import dagger.Subcomponent; |
This file contains hidden or 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 com.example; | |
import javax.inject.Scope; | |
import javax.inject.Singleton; | |
import dagger.Component; | |
import dagger.Module; | |
import dagger.Provides; | |
public class Test { |
This file contains hidden or 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
<link rel="import" href="../topeka-elements/topeka-datasource.html"> | |
<link rel="import" href="../topeka-elements/theme.html"> | |
<link rel="import" href="../topeka-elements/topeka-resources.html"> | |
<link rel="import" href="../topeka-elements/topeka-app.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { |
NewerOlder