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 com.tombarrasso.android; | |
/* | |
* Copyright (c) 2014. Thomas James Barrasso | |
* | |
* Licensed to the Apache Software Foundation (ASF) under one | |
* or more contributor license agreements. See the NOTICE file | |
* distributed with this work for additional information | |
* regarding copyright ownership. The ASF licenses this file | |
* to you under the Apache License, Version 2.0 (the |
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 me.barrasso.android.volume.ui; | |
/* | |
* Copyright (C) 2010 The Android Open Source Project | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 |
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
/* All of our custom controls should be what we expect them to be */ | |
input, | |
textarea { | |
-webkit-box-sizing:content-box; | |
-moz-box-sizing:content-box; | |
box-sizing:content-box; | |
} | |
/* | |
Show overflow in Edge |
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
// Trie.js - super simple JS implementation | |
// https://en.wikipedia.org/wiki/Trie | |
// From https://gist.github.com/tpae/72e1c54471e88b689f85ad2b3940a8f0 | |
// Modified to support key -> value mapping for quick object retrieval, | |
// using an ES6 Map instead of plain JS object, and optional case insensitivity. | |
// Values are automatically converting to arrays to support multiple values | |
// mapped to a single tree leaf. | |
// Example: |
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
(() => { | |
let timeouts = []; | |
let intervals = []; | |
const _setTimeout = window.setTimeout; | |
const _setInterval = window.setInterval; | |
const _clearTimeout = window.clearTimeout; | |
const _clearInterval = window.clearInterval; | |
window.setTimeout = (func, delay) => { |
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 java.util.stream.IntStream; | |
import java.util.Arrays; | |
// O(n^2) solution to the Trapped Water Problem | |
// @see https://techdevguide.withgoogle.com/paths/advanced/volume-of-water/ | |
public class TrappedWater { | |
public static void main(String args[]) { | |
int[] sampleTopography = { 1,3,2,4,1,3,1,4,5,2,2,1,4,2,2 }; | |
int trappedWaterVolume = getTrappedWater(sampleTopography); |
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 java.util.stream.*; | |
import java.util.Arrays; | |
// O(n) solution to the Trapped Water Problem | |
// @see https://techdevguide.withgoogle.com/paths/advanced/volume-of-water/ | |
public class TrappedWater { | |
public static void main(String args[]) { | |
int[] sampleTopography = { 1,3,2,4,1,3,1,4,5,2,2,1,4,2,2 }; | |
int trappedWaterVolume = getTrappedWater(sampleTopography); |
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
public static TemporalAdjuster LAST_WORKING_DAY = TemporalAdjusters.ofDateAdjuster(lastDayOfMonth -> { | |
int daysToSubtract = Math.max(0, lastDayOfMonth.getDayOfWeek().getValue() - DayOfWeek.FRIDAY.getValue()); | |
return lastDayOfMonth.minusDays(daysToSubtract); | |
}); | |
// Example Usage | |
LocalDate.now().with(LAST_WORKING_DAY); |
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
"war".toUpperCase().split("").reverse().join(""); |
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
"war" | |
|> String.upcase | |
|> String.split("") | |
|> Enum.reverse | |
|> Enum.join("") |
OlderNewer