Skip to content

Instantly share code, notes, and snippets.

Avatar

Dexter M Haslem DexterHaslem

View GitHub Profile
View pi3_1mhz_spi.py
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
View warsow_build_notes.md

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:

View gs_weapondefs.c
/*
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 Dec 1, 2017
java fizzbuzz
View fb.java
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 Sep 15, 2017
how to create a working java keystore from godaddy bundled files
View gist:bfcdec8cd258930a04fdaf72088ce5e9
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"
View remove_w8_telemetry.bat
@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
View life.sql
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)
View adbss.ps1
#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 Feb 29, 2016
gulp MODERN (feb 2016), WORKING babel + react + sourcemaps. millions of outdated bad examples
View .babelrc
{ "presets": ["react"], "sourceMaps": true }
View test2.rkt
#lang racket
(struct fix-tag (tag contents))
(define fix-soh (string (integer->char 01)))
(define (compute-checksum tags)
1)
;; creates tag string with SOH attached
(define (create-tag id contents)
You can’t perform that action at this time.