Skip to content

Instantly share code, notes, and snippets.

@Denton-L
Denton-L / Encrypter.c
Last active August 29, 2015 14:12
A Simple XOR Cipher
#include <stdio.h>
int main(int argc, char *argv[]) {
FILE *input, *key, *output;
int inchar, keychar;
if (argc != 4) {
printf("Usage: \"%s [input] [key] [output]\"", argv[0]);
return -1;
}
@Denton-L
Denton-L / EulersMethod.java
Last active August 29, 2015 14:14
Euler's Method for Estimating Differential Equations
public class EulersMethod {
private double x1;
private double y1;
private double dx;
private double x2;
private Differential dydx;
public interface Differential {
double equation(double x, double y);
@Denton-L
Denton-L / sieve.c
Last active August 29, 2015 14:26
Generates all prime numbers less than 1000000 using the Sieve of Eratosthenes.
#include <stdlib.h>
/*
* returns an int[] where int[0] is the length of the array
* and subsequent elements are the primes themselves.
*/
int* findprimes(int range) {
int prime = 2;
int i;
int *notprime = calloc(sizeof(notprime), range);
#define PADDLEHEIGHT 5
#define BALLSIZE 3
short *PA = 0x8000;
short *PB = 0x8001;
short *DDRA = 0x8002;
short *DDRB = 0x8003;
short pbbuff;
short paddle;
@Denton-L
Denton-L / mthesaur.txt
Created December 4, 2016 08:12
Moby Thesaurus
a cappella,abbandono,accrescendo,affettuoso,agilmente,agitato,amabile,amoroso,appassionatamente,appassionato,brillante,capriccioso,con affetto,con agilita,con agitazione,con amore,crescendo,decrescendo,diminuendo,dolce,forte,fortissimo,lamentabile,leggiero,morendo,parlando,pianissimo,piano,pizzicato,scherzando,scherzoso,sordo,sotto voce,spiccato,staccato,stretto,tremolando,tremoloso,trillando
a la mode,advanced,avant-garde,chic,contemporary,dashing,exclusive,far out,fashionable,fashionably,forward-looking,in,in the mode,mod,modern,modernistic,modernized,modish,modishly,newfashioned,now,present-day,present-time,progressive,soigne,soignee,streamlined,stylish,stylishly,tony,trendy,twentieth-century,ultra-ultra,ultramodern,up-to-date,up-to-datish,up-to-the-minute,vogue,voguish,way out
a priori,a fortiori,a posteriori,analytic,back,backward,categorical,conditional,deducible,deductive,derivable,dialectic,discursive,dogmatic,early,enthymematic,epagogic,ex post facto,hypothetical,inductive,inferential,into the past,m
@Denton-L
Denton-L / webhook.py
Last active August 15, 2017 12:26
A quick and dirty server. You can set up a webhook to point to it and, whenever the endpoint is hit, it will automatically git pull.
#!/usr/bin/env python3
import http.server
import socketserver
import subprocess
GIT_DIRECTORY='<directory>'
ENDPOINT='/<endpoint>'
PORT=0
function main() {
var threads = GmailApp.search('label:unread -label:inbox');
for (var i = 0; i < threads.length; i++) {
threads[i].markRead();
}
Logger.log("%s threads were marked read.", threads.length.toString());
}
#!/bin/sh
IP_HEAD=`ip route | perl -ne '/^(\d{1,3}\.\d{1,3}\.\d{1,3}\.)\d{1,3}\/\d{1,2} dev/ && print $1'`
for i in `seq 0 255`
do
curl -X POST $IP_HEAD$i:1337/lock --connect-timeout 1 > /dev/null 2>&1 &
done
@Denton-L
Denton-L / clear-stale.sh
Created April 27, 2019 00:10
clear-stale.sh
#!/bin/sh
git ls-remote --heads "$1" |
cut -f2 |
sed -e 's|refs/heads/||' |
while read b
do
if [ `git rev-list --count "$2".."$1/$b"` -eq -0 -a "$b" != "$2" ]
then
echo $b
@Denton-L
Denton-L / State of California Sexual Harassment Prevention Training Skip
Last active August 10, 2023 14:19
Speedrunning State of California Sexual Harassment Prevention Training
If, as part of your job, you're obligated to do this training, you don't
actually have to wait for the button to ungrey as you sit through the dialog.
You can simply open up the JavaScript console of your browser and execute
DS.pubSub.trigger(DS.events.presentation.ON_OBJECT_EVENT, "next_pressed");
and this will automatically take you to the next slide. Just keep spamming this
until you're through the training. If you're forced to answer a question,
remember that the answer is probably true!