Skip to content

Instantly share code, notes, and snippets.

View thekeenant's full-sized avatar

Keenan thekeenant

View GitHub Profile
@thekeenant
thekeenant / LogitechGamepad.java
Created August 28, 2015 15:54
For use with FRC robots.
/*
* See class javadoc for usage instructions.
*/
package org.usfirst.frc.team2508.robot.lib;
import edu.wpi.first.wpilibj.GenericHID;
import edu.wpi.first.wpilibj.Joystick;
/**
@thekeenant
thekeenant / Profile.java
Last active August 29, 2015 14:15
Search Minecraft profiles by name or UUID. Requires Gson.
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
@thekeenant
thekeenant / Paginator.java
Last active April 2, 2016 04:47
Paginate a list.
package net.avicus.atlas.util;
import java.util.ArrayList;
import java.util.List;
/**
* Pagintes a list of items.
* @param <T>
*/
public class Paginator<T> {
@thekeenant
thekeenant / tunnel.md
Created June 22, 2016 20:10 — forked from gdamjan/README.md
Setup for an easy to use, simple reverse http tunnels with nginx and ssh. It's that simple there's no authentication at all.The end result, a single ssh command invocation gives you a public url for your web app hosted on your laptop.

What

A lot of times you are developing a web application on your own laptop or home computer and would like to demo it to the public. Most of those times you are behind a router/firewall and you don't have a public IP address. Instead of configuring routers (often not possible), this solution gives you a public URL that's reverse tunnelled via ssh to your laptop.

Because of the relaxation of the sshd setup, it's best used on a dedicated virtual machine just for this (an Amazon micro instance for example).

Requirements

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import 'dart:math';
import 'dart:ui';
import 'package:meta/meta.dart';
@immutable
class MonotoneInterpolator {
const MonotoneInterpolator._(this.points, this._c1s, this._c2s, this._c3s);
final List<Offset> points;

Information Collection And Use

For a better experience while using our Service, we may require you to provide us with certain personally identifiable information, including but not limited to your name, phone number, and postal address. The information that we collect will be used to contact or identify you.

@thekeenant
thekeenant / GdxScheduledExecutorService.java
Last active May 23, 2019 23:02
An implementation of ScheduledExecutorService for LibGDX which executes tasks on the main game thread.
import com.badlogic.gdx.Gdx;
import java.util.Collection;
import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
@thekeenant
thekeenant / Sidebar.java
Last active August 25, 2019 00:48
A simple Bukkit scoreboard sidebar API.
package net.avicus.atlas.util;
import com.google.common.base.Preconditions;
import com.google.common.base.Splitter;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Lists;
import com.google.common.collect.Multimap;
import lombok.Data;
import lombok.Getter;
import lombok.ToString;
@thekeenant
thekeenant / Derivatives.java
Last active August 20, 2023 15:53
Approximate the derivative of a function in Java.
import java.util.function.DoubleFunction;
public class Derivatives {
// approximate the limit
private static final double DX = 0.0001;
/**
* @param f f(x), the function to derive
* @return f'(x), the derivative of the f(x)
*/