Skip to content

Instantly share code, notes, and snippets.

Avatar

Kyle Agronick agronick

  • Zumper
  • Rhode Island
View GitHub Profile
View React tick tack toe.jsx
import React from 'react';
import './App.css';
import { useState } from 'react';
import cloneDeep from "lodash-es/cloneDeep";
import shuffle from "lodash-es/shuffle";
class WinLocation {
constructor() {
this.posArray = [];
@agronick
agronick / vlctv.sh
Created Dec 3, 2018
VLC Linux with Chromecast: Solution to error "gnutls tls client error: Certificate verification failure: The certificate is NOT trusted. The certificate issuer is unknown. The name in the certificate does not match the expected. "
View vlctv.sh
#!/bin/bash
# On my machine VLC fails to connect to chromecast. If I specify the IP it fails to connect because of certificate errors. I can
# manually download the certificate but it is only valid for 2 days. This little script gets it all working.
# Set your ip address below and call this script with the filename.
CHROMECAST_IP=192.168.1.153
gnutls-cli --save-cert=chromecast.pem --insecure $CHROMECAST_IP:8009
mkdir -p ~/.local/share/vlc/certs
mv chromecast.pem ~/.local/share/vlc/certs
@agronick
agronick / async.py
Created Apr 1, 2018
CPU Bound code runs 3x-5x slower with asyncio
View async.py
import asyncio
import time
loop = asyncio.new_event_loop()
def print_time():
global start
end = time.time()
print(end - start)
@agronick
agronick / sample.py
Created Apr 1, 2018
Still in 2018 threads in Python do not make CPU bound tasks faster
View sample.py
import time
from concurrent.futures import ThreadPoolExecutor
import random
start = 0
def print_time():
global start
end = time.time()
print(end - start)