Skip to content

Instantly share code, notes, and snippets.

View assertivist's full-sized avatar

andy assertivist

View GitHub Profile
@assertivist
assertivist / gist:4263597
Created December 12, 2012 00:05
collision code with sweep test instead of rigid bodies PS it doesn't work
def update(self, dt):
dt = min(dt, 0.2) # let's just temporarily assume that if we're getting less than 5 fps, dt must be wrong.
yaw = self.movement['left'] + self.movement['right']
self.rotate_by(yaw * dt * 60, 0, 0)
walk = self.movement['forward'] + self.movement['backward']
speed = 0
if self.on_ground:
speed = walk
self.xz_velocity = self.position()
@assertivist
assertivist / dicebot.py
Created August 22, 2013 04:31
the worst dicebot
#!/usr/pkg/bin/python2.7
import sys, socket, string, time, random, subprocess, random, datetime, code
import re
HOST="67.23.2.128"
PORT=6667
NICK="dicebot9K"
IDENT="v0.04"
@assertivist
assertivist / geom.py
Last active July 27, 2023 02:59
A tiny library to create primitive procedural geometry in Panda3d - Apache 2.0 license
"""
Copyright 2021 D. Watson, J. Voss, R. Herriman, A. Halstead
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@assertivist
assertivist / joy_input.py
Last active January 22, 2016 20:15
Joystick support in P3d using Pyglet
import math
try:
import pyglet.input
import pyglet.app
except:
pyglet = None
print("pyglet import failed - no joysticks for you")
AXIS_ENGAGE_THRESHOLD = 0.359
#!/bin/sh
# list of MAC addresses, 1 per line
MACFILE="/jffs/etc/config/maclist"
# current mac address
current_mac=$( nvram get def_hwaddr )
# get current MAC index from file
macindex=$( grep -n $current_mac $MACFILE | cut -f1 -d: )
//#define MIDI_CHANNEL 1
int buttons[8][16] = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@assertivist
assertivist / snkeepalive.sh
Created August 28, 2017 19:57
keeps a ServiceNow developer instance awake, at least until the nightly snooze-all
#!/bin/bash
# put your instance id here
instance="dev######"
# make sure your password doesn't have shell operators in it
credentials="admin:password"
while true; do
entropy=`rand`
outdata="{\"short_description\":\"Automated incident $entropy\"}"
<map designer="mantis - derek@leapnet.com">
<sky horizon="0.000,0.400,1.000" color="0.000,0.200,0.600"/>
<ground color="0.000,0.000,0.333"/>
<incarnator location="63.417,30,63.417" heading="315.0"/>
<incarnator location="31.694,30,63.417" heading="45.0"/>
<incarnator location="31.583,30,31.472" heading="145.0"/>
<incarnator location="63.417,30,31.472" heading="225.0"/>
<incarnator location="47.083,63,47.472" heading="145.0"/>
<incarnator location="47.083,63,47.472" heading="145.0"/>
<static>
@assertivist
assertivist / SFTP Client.js
Created May 24, 2018 20:24 — forked from paulsena/SFTP Client.js
ServiceNow SFTP / SSH Javascript Client
var Sftp = Class.create();
Sftp.prototype = {
initialize: function() {
gs.print("Setting up SSH client.");
this.dataSourceID = '';
this.hostname = '';
this.port = 22;
this.username = '';
this.password = '';
SELECT * FROM
(SELECT
MachineID as ResourceID,
InstanceKey + 32000000 as GroupID,
DelDate
FROM SCCM_Ext.Add_Remove_Programs_DATA_DD