Skip to content

Instantly share code, notes, and snippets.

View benzap's full-sized avatar
🏠
Working from home

Benjamin Zaporzan benzap

🏠
Working from home
View GitHub Profile
@benzap
benzap / .emacs.el
Last active September 14, 2023 14:39
Emacs Configuration
;; add our main ~/.emacs.d/ to the load-path (if it hasn't already been done)
;;(add-to-list 'load-path "~/.emacs.d/")
(setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/")
("marmalade" . "http://marmalade-repo.org/packages/")
("melpa" . "http://melpa.milkbox.net/packages/")))
(package-initialize)
;; Package Require function. It resolves any require dependencies
;; through the package manager.
(setq package-refresh-first-time nil)
@benzap
benzap / youtube2mp3.py
Last active May 3, 2022 05:39
Youtube to MP3 Downloader Script
#!/bin/env python
# Requires: youtube_dl module
# Requires: ffmpeg
# Usage:
#
# python youtube2mp3.py <URL>, ...
#
# Example:
#
# python youtube2mp3.py https://www.youtube.com/watch?v=dQw4w9WgXcQ
@benzap
benzap / byte.cljc
Last active March 16, 2022 09:41
Working with bytes between clojure and clojurescript
(ns byte
"My own take on byte conversion. `(byte)` doesn't work with unsigneds
within clojure, and signed values don't work well within
clojurescript. Includes additional bitwise functions for working
specifically with bytes.")
(defn signed
"Signed byte that works between clojure and clojurescript.
@benzap
benzap / makefile
Created June 3, 2012 04:30
makefile for portable code between mingw and linux builds
#Written By: Benjamin Zaporzan
UNAME := $(shell uname)
CC = g++
PROGRAM_NAME =
OBJ =
##########################
######## Linux ###########
##########################
ifeq ($(UNAME), Linux)
#include specific variables for jobs
;; In response to blog post:
;; https://medium.com/@kasperpeulen/10-features-from-various-modern-languages-that-i-would-like-to-see-in-any-programming-language-f2a4a8ee6727
;; Run with lumo
;; https://github.com/anmonteiro/lumo
;;
;; # npm install -g lumo-cljs
;; lumo clojurescript-feature-examples.cljs
@benzap
benzap / p3.rs
Created December 4, 2018 03:07
Broken Implementation for Problem 3
// Problem 3
#![allow(unused)]
extern crate regex;
use std::default::Default;
use std::collections::HashMap;
use std::collections::HashSet;
use std::io::BufReader;
use std::io::BufRead;
@benzap
benzap / MultiLinkedList.sol
Last active October 5, 2018 22:13
Multi Linked List Implementation in Solidity
pragma solidity ^0.4.24;
/*
Title:
Multiple Linked List Storage
Description:
Dynamic Storage Contract for storing multiple linked lists each
uniquely identified by a key. Implementation allows for
@benzap
benzap / hiccup2xml
Last active September 20, 2018 15:55
hiccup2xml script written in eden
#!/usr/bin/env eden
local help-message = "
hiccup2xml - Hiccup Markup to XML Markup
Usage:
hiccup2xml read <filename>
hiccup2xml eval <string>
@benzap
benzap / ChefFactory.sol
Last active September 18, 2018 18:31
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.25+commit.59dbf8f1.js&optimize=true&gist=
pragma solidity ^0.4.7;
contract ChefFactory {
event CreateChef(address _address);
struct Chef {
uint8 cooking_ability; // Personal Cooking Rating 1-10
uint8 baddaboops; // Acquired Taste Rating 1-10
}
@benzap
benzap / i3-config
Created September 7, 2018 15:59
~/.i3/config file for i3 window manager
# i3 config file (v4)
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
#
# This config file uses keycodes (bindsym) and was written for the QWERTY
# layout.
#
# To get a config file with the same key positions, but for your current
# layout, use the i3-config-wizard
#