Skip to content

Instantly share code, notes, and snippets.

View Jylanthas's full-sized avatar

Jason J Kraft Jylanthas

View GitHub Profile
#!/usr/bin/env python
import sys
import urllib
import requests
import itertools
from requests.adapters import HTTPAdapter
class RideMatch(object):
"""docstring for Scraper"""
@Jylanthas
Jylanthas / pdptw_max_dur_issue.py
Last active November 19, 2019 12:17
OR-tools CVRPTW + pickup and delivery, issue with per-customer max duration constraint
import sys, os, math
from ortools.constraint_solver import pywrapcp
from ortools.constraint_solver import routing_enums_pb2
import matplotlib.pyplot as plt
import np
def getopts(argv):
opts = {} # Empty dictionary to store key-value pairs.
while argv: # While there are arguments left to parse...
if argv[0][0] == '-': # Found a "-name value" pair.
@Jylanthas
Jylanthas / testMat1.22.ino
Created August 26, 2016 06:49
Hermia's LED Cape
#include <FastLED.h>
#define DATA_PIN 6
#define COLOR_ORDER GRB
#define CHIPSET WS2812B
#define BRIGHTNESS 192
// Defining button
const int buttonPin = 2;
file = open(kml_path)
doc = Nokogiri::XML(file.read)
corridors = doc.css('kml Document Placemark').map { |placemark|
next unless corridor?(placemark)
create_polygon(placemark)
}
def factory
@factory ||= Locality.new.latlng.factory
@Jylanthas
Jylanthas / alarm.rb
Created December 13, 2015 05:01
wake the hell up! (when you don't have your phone)
def forever
i = 0
while true
yield i
i = i + 1
end
end
def alarm!(msg)
forever { `say '#{msg}'` }
<input class="form-control" type="text" unix-time-directive="timeFormat" ng-model="t.pickup_time">
.directive('unixTimeDirective', function(moment) {
function link(scope, element, attrs, ngModelController) {
var format = scope.$eval(attrs.unixTimeDirective);
scope.$watch(attrs.unixTimeDirective, function(value) {
format = value;
});
ngModelController.$parsers.push(function(data) {
@Jylanthas
Jylanthas / gist:6f3d6b4b840da703c4d3
Last active August 29, 2015 14:20
routific test
require 'routific'
require 'json'
# Set the Routific API token
Routific.setToken('eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJfaWQiOiI1NTIwN2Q2MTRiMzYyMjBhMDAwYzhlNjEiLCJpYXQiOjE0MjgxOTI2NTl9.gzapZ2hLNwGxGBNUaXJX6xv4osfz4nPUu0KzdhwMm0s')
def main
test1
# test2
end