Skip to content

Instantly share code, notes, and snippets.

View TristanWiley's full-sized avatar

Tristan Wiley TristanWiley

View GitHub Profile
package com.tristanwiley;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class Main {
public static void main(String[] args) {
String input = "toggle 461,550 through 564,900|turn off 370,39 through 425,839|turn off 464,858 through 833,915|turn off 812,389 through 865,874|turn on 599,989 through 806,993|turn on 376,415 through 768,548|turn on 606,361 through 892,600|turn off 448,208 through 645,684|toggle 50,472 through 452,788|toggle 205,417 through 703,826|toggle 533,331 through 906,873|toggle 857,493 through 989,970|turn off 631,950 through 894,975|turn off 387,19 through 720,700|turn off 511,843 through 581,945|toggle 514,557 through 662,883|turn off 269,809 through 876,847|turn off 149,517 through 716,777|turn off 994,939 through 998,988|toggle 467,662 through 555,957|turn on 952,417 through 954,845|turn on 565,226 through 944,880|turn on 214,319 through 805,722|toggle 532,276 through 636,847|toggle 619,80 through 689,507|turn on 390,706 through 884,722|t
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package day8;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package day8;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package day14;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
{
"destination_addresses": [
"College Park, MD, USA",
"Rochester, NY, USA"
],
"origin_addresses": [
"Marietta, NY 13110, USA"
],
"rows": [
{
@TristanWiley
TristanWiley / Carl
Last active February 4, 2016 16:05
var images = document.getElementsByTagName('img');
for(var i = 0; i < images.length; i++) {
images[i].src = "http://tristanwiley.com/labs/carl/carl.jpg";
}
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://feeds.feedburner.com/xkcd/xkcd?format=xml");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADERFUNCTION, "HandleHeaderLine");
$body = curl_exec($ch);
function HandleHeaderLine($curl, $header_line){
$headers .= $header_line . "<br>";
@TristanWiley
TristanWiley / JMR.js
Last active March 9, 2016 21:41
Code for JMR
//This code appends the jquery script to the website, basically making any jquery functions work.
var s = document.createElement('script');
s.setAttribute('src', "https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js");
document.body.appendChild(s);
//This code listens for changes to the body with a MutationObserver, only issue is that sometimes the jQuery script isn't added
//until after this runs so an error occurs, I'd suggest injecting the above code then injecting this code, not really sure how to
//fix it, I'm sure you can figure it out. Basically once the above code is injected the below will work. Then when something
//changes i.e. them expanding the box the text #changed will be added, since this may occur more than once you might want to change
//this so it adds a number or something. Then all you have to do in your app is listen for a URL change. Tada!
window.addEventListener('keydown', e => {
if( input.value === '/collapse' ) {
collapseAll();
input.value = '';
e.stopPropagation();
}else if(input.value === '/uncollapse'){
unCollapseAll();
}
}, true);
Hi everyone, this is a backer-only post, because it primarily involves backers. We don’t want announcements in regards to you all, to be a shock to you all.
Later this week, we’re announcing our first hardware deal - and later this month, our first hardware. It’s a big change for Console, and it’s going to change what we do.
We still hope to make Console OS. But as Jide and Remix OS have found, it’s not a very profitable business. Millions of downloads, doesn't always mean millions in funding. Had they reached out to us, we would have told them that from the get-go. Between Google entering the PC space with Android, and Intel backing away from Android on PC - after we couldn’t stop development of Console OS… it’s a painful double-whammy.
Worse, Google isn’t bringing what you all want to the PC space. They’re bringing Chromebooks that run Android apps, not true Android. So, there’s still room for us, but it may not be in offering a PC OS for existing computers.
In the wake of those post-campaign changes, t