Skip to content

Instantly share code, notes, and snippets.

View benj02's full-sized avatar

Ben Johnson benj02

  • Bellingham, WA, USA
View GitHub Profile
#ifndef __TARGET_H_
#define __TARGET_H_
#include <stdlib.h>
#include <stdbool.h>
struct command {
struct command* next;
char* line;
;;; init.el -*- lexical-binding: t; -*-
(doom! :feature
;; debugger ; FIXME stepping through code, to help you add bugs
eval ; run code, run (also, repls)
(evil +everywhere) ; come to the dark side, we have cookies
;; file-templates ; auto-snippets for empty files
lookup ; helps you navigate your code and documentation
;; snippets ; my elves. They type so I don't have to
;; spellcheck ; tasing you for misspelling mispelling
@benj02
benj02 / README.md
Created March 30, 2018 04:12
readme

Josh's Machine Control Panel

Running on windows

First install node.js, get the latest version.

Then, with this folder extracted somewhere convenient (Like C:\), open a command prompt window in the folder. Then enter the following commands:

@benj02
benj02 / gist:bbdf7dab59e2cdeecad5
Last active August 29, 2015 14:22
emacs init.el
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages"))
(add-to-list 'package-archives '("marmalade" . "https://marmalade-repo.org/packages/"))
(defvar my-packages '(better-defaults smex yasnippet ido-ubiquitous php-mode))
(package-initialize)
(dolist (p my-packages)
(when (not (package-installed-p p))
# Allows for any file to be extracted using: x $1
x () {
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) rar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xvf $1 ;;
import wave, struct, sys
from math import pow, sin
samples = 100000
terms = 50
normalizer = 32768/1.5
weier = wave.open('weierstrass.wav', 'w')
weier.setparams((1, 2, 44100, 0, 'NONE', 'not compressed'))
print "Progress (%):",
for i in range(samples):
x = float(1000*i)/samples
@benj02
benj02 / franticupdate
Created December 26, 2011 01:47
franticupdate
package org.frantictools.franticupdatechooser;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
if(GuiIngame.PlaceBlock)
{
for(int a = -GuiConsole.cdx; a<=GuiConsole.cdx; a++)
{
for(int b = -GuiConsole.cdy; b<=GuiConsole.cdy; b++)
{
for(int c = -GuiConsole.cdz; c<=GuiConsole.cdz; c++)
{
if(mc.theWorld.getBlockId(i+a, j+b, k+c) != 0)
{