Skip to content

Instantly share code, notes, and snippets.

View DexterHaslem's full-sized avatar
💭
why are you taking advice from a site that goes down weekly?

Dexter M Haslem DexterHaslem

💭
why are you taking advice from a site that goes down weekly?
View GitHub Profile

Keybase proof

I hereby claim:

  • I am dexterhaslem on github.
  • I am dexterhaslem (https://keybase.io/dexterhaslem) on keybase.
  • I have a public key ASBEZoNu3cefQV0n65ElxdrcDH9uQLZ4cZzU62snmSCL9go

To claim this, I am signing this object:

import spidev
import time
spi = spidev.SpiDev()
spi.open(0, 0)
# getting pi 3 or later (bcm2835 +) to generate 1 MHz spi clock is possible, but stupid:
# setting to 1.6 MHz math works out generating a 1 MHz clock output..
hz = 1600000
i = 0
@DexterHaslem
DexterHaslem / warsow_build_notes.md
Last active July 16, 2019 12:48
warsow build notes

after deleting everyhting and trying again i got it to work.. its worth noting, libs were automatically picked up for me. I think where you got in trouble was pointing libs at a directly instead of the static .lib file cmake was wanting, alas here is what i did.

I have vs2015, 2017, 2019 and mingw installed. when building I opened solutions in 2019 and built with 2015 tools

prerequisites

  1. if you already installed cmake for windows, uninstall it
  2. install the LATEST CMake 3.14.5 (ya really), but not the RC from here, add to path when asked

if you want to build with mingw:

/*
Copyright (C) 1997-2001 Id Software, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@DexterHaslem
DexterHaslem / fb.java
Last active December 1, 2017 22:12
java fizzbuzz
import java.util.stream.IntStream;
public class Main {
public static void main(String[] args) {
IntStream.range(1, 101).forEach(i -> System.out.println(String.format("%d %s%s", i, i % 3 == 0 ? "Fizz" : "", i % 5 == 0 ? "Buzz" : "")));
}
}
@DexterHaslem
DexterHaslem / gist:bfcdec8cd258930a04fdaf72088ce5e9
Created September 15, 2017 16:22
how to create a working java keystore from godaddy bundled files
keytool -genkey -alias tomcat -keyalg RSA -keysize 2048 -keystore keystore.jks
keytool -importkeystore -srckeystore keystore.jks -destkeystore keystore.p12 -deststoretype PKCS12
openssl pkcs12 -in keystore.p12 -out tomcatkey.pem -nodes
cat domain.crt gd_bundle-g2-g1.crt > combinedcerts
openssl pkcs12 -export -chain -CAfile gd_bundle-g2-g1.crt -in combinedcerts -inkey tomcatkey.pem -out tomcat.keystore -name tomcat -passout pass:myPassword
# then create connector like so
<Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
maxThreads="100"
@echo off
rem removes all windows 8.1 telemetry updates
rem it's recommended to hide them in windows update so you don't reinstall them
wusa /uninstall /kb:3065988 /quiet /norestart
wusa /uninstall /kb:3083325 /quiet /norestart
wusa /uninstall /kb:3083324 /quiet /norestart
wusa /uninstall /kb:2976978 /quiet /norestart
wusa /uninstall /kb:3075853 /quiet /norestart
wusa /uninstall /kb:3065987 /quiet /norestart
CREATE SCHEMA IF NOT EXISTS life;
SET search_path = life;
CREATE TABLE IF NOT EXISTS life.state (
generation SERIAL PRIMARY KEY NOT NULL,
--size INT NOT NULL CHECK (size >= 3),
state BOOL []
);
CREATE OR REPLACE FUNCTION life.neighbor_alive_count(u BOOL [], x INT, y INT)
#expects platform tools in path (usually like AppData\Local\Android\sdk\platform-tools)
$ts = [int64](([datetime]::UtcNow)-(get-date "1/1/1970")).TotalMilliseconds
$file = "image$ts.png"
if ($args[0])
{
$destdir = $args[0]
}
else
{
@DexterHaslem
DexterHaslem / .babelrc
Created February 29, 2016 16:03
gulp MODERN (feb 2016), WORKING babel + react + sourcemaps. millions of outdated bad examples
{ "presets": ["react"], "sourceMaps": true }