Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Benjamin Zaporzan benzap

🏠
Working from home
Block or report user

Report or block benzap

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@benzap
benzap / p3.rs
Created Dec 4, 2018
Broken Implementation for Problem 3
View p3.rs
// 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 Oct 5, 2018
Multi Linked List Implementation in Solidity
View MultiLinkedList.sol
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 / byte.cljc
Last active Sep 24, 2018
Working with bytes between clojure and clojurescript
View byte.cljc
(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 / hiccup2xml
Last active Sep 20, 2018
hiccup2xml script written in eden
View hiccup2xml
#!/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 Sep 18, 2018
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=
View ChefFactory.sol
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 Sep 7, 2018
~/.i3/config file for i3 window manager
View i3-config
# 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
#
@benzap
benzap / edn_linter.cljc
Created Aug 4, 2018
EDN Linter Example Use Case
View edn_linter.cljc
(ns edn-linter
;; require name of edn linter
(:require [the-name :refer [parse-with-info]]
(def input-string "[:a :b
{:test 123}]")
(def parsed-edn (parse-with-info input-string))
;; {:line 0
;; :type :vector
@benzap
benzap / higher-order-fizzbuzz.fif
Created May 28, 2018
Higher Order fizzbuzz from reddit post
View higher-order-fizzbuzz.fif
;; From reddit comments
;; https://www.reddit.com/r/Clojure/comments/8lizcb/rclojure_fizz_buzz_contest_hardmode/
$clear-stack
doc higher-fizzbuzz
"( map seq -- seq ) Returns modified seq with map target factors."
fn higher-fizzbuzz
*xs <> setl
*m <> setl
@benzap
benzap / fif-repl.cljs
Last active May 28, 2018
Fif Interactive Repl Used in blog posts
View fif-repl.cljs
(ns website.fif-repl
(:require
[clojure.string :as str]
[rum.core :as rum]
[fif.core :as fif]
[fif.stack-machine :as stack]
[fif.stack-machine.error-handling :refer [set-error system-error]]
;; Nothing to see here
[website.repl-imports :refer [import-super-secret-words]]))
@benzap
benzap / fizzbuzz.fif
Last active May 28, 2018
Fizzbuzz in fif langauge github.com/benzap/fif
View fizzbuzz.fif
fn fizz-buzz
*n <> setl
n 3 mod zero?
n 5 mod zero? and if "FizzBuzz" else
n 3 mod zero? if "Fizz" else
n 5 mod zero? if "Buzz" else
n
then then then
endfn
You can’t perform that action at this time.