Skip to content

Instantly share code, notes, and snippets.

View diegotori's full-sized avatar

Diego Tori diegotori

  • GFT
  • Chappaqua, NY
  • 11:07 (UTC -04:00)
  • LinkedIn in/diegotori
View GitHub Profile
@HansMuller
HansMuller / system_back.dart
Last active February 14, 2022 20:49
Bottom navigation example with a Navigator per destination
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flutter code sample for NavigationBar with nested Navigator destinations.
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
class Destination {
@christopherperry
christopherperry / ExpiringLruCache.java
Last active February 16, 2024 15:12
LruCache for Android with expiring keys. Instead of modifying LruCache directly I used delegation to get around final keyword usage and a dirty hack to override everything else.
import android.os.SystemClock;
import android.support.v4.util.LruCache;
import java.util.HashMap;
import java.util.Map;
/**
* An Lru Cache that allows entries to expire after
* a period of time. Items are evicted based on a combination
* of time, and usage. Adding items past the {@code maxSize}
@zac-xin
zac-xin / AddBinary.java
Created December 26, 2012 16:58
Given two binary strings, return their sum (also a binary string). For example, a = "11" b = "1" Return "100".
public class Solution {
public String addBinary(String a, String b) {
// Start typing your Java solution below
// DO NOT write main() function
int la = a.length();
int lb = b.length();
int max = Math.max(la, lb);
StringBuilder sum = new StringBuilder("");