Skip to content

Instantly share code, notes, and snippets.

View bobbicodes's full-sized avatar
💭
Moved to bobbicodes on Codeberg

Bobbi Towers bobbicodes

💭
Moved to bobbicodes on Codeberg
View GitHub Profile
#!/usr/bin/python2.7
# Assign numbers to items and print menu:
print 'Building Supplies Store Hardware Store'
print '----------------------- --------------'
print '1. Nails 7. Hammers'
print '2. Boards 8. Tape measures'
print '3. Bricks 9. Shovels'
print '4. Gum 10. Spatulas'
print '5. Glue 11. Ladders'
print '6. Paint 12. Drills'
@bobbicodes
bobbicodes / blog-post.md
Created February 13, 2018 17:26 — forked from lazywithclass/blog-post.md
Looking at the most beautiful program ever written - part 1

Looking at the most beautiful program ever written - part 1

I am going to have a look at what William Byrd presented as The most beautiful program ever written.

Beauty here refers to computer programs, specifically about Lisp. There might be errors as this is something I wrote to make sense of that interpreter, proceed at your own risk.

Thanks a lot to Carl J. Factora for the help.

The program

@bobbicodes
bobbicodes / .spacemacs
Last active October 4, 2018 04:43
Spacemacs Config
;; -*- mode: emacs-lisp; lexical-binding: t -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Layer configuration:
This function should only modify configuration layer settings."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
;; `+distribution'. For now available distributions are `spacemacs-base'
(ns ctrain.core
(:require [clojure.string :as s]
[clojure.set :refer :all])
(:gen-class))
(def problems (read-string (slurp "problems.edn")))
(defn print-prob [n]
(println (str "\n#" n ": " (:title (nth problems (dec n)))))
(println (str "\n" (:description (nth problems (dec n))) "\n"))
void editorDrawRows(struct abuf *ab) {
int y;
for (y = 0; y < E.screenrows; y++) {
int filerow = y + E.rowoff;
if (filerow >= E.numrows) {
if (E.numrows == 0 && y == E.screenrows / 3) {
char welcome[80];
int welcomelen = snprintf(welcome, sizeof(welcome),
"Bob, the text editor");
if (welcomelen > E.screencols) welcomelen = E.screencols;
void editorDrawRows(struct abuf *ab) {
int y;
for (y = 0; y < E.screenrows; y++) {
int filerow = y + E.rowoff;
if (filerow >= E.numrows) {
if (E.numrows == 0 && y == E.screenrows / 3) {
char welcome[80];
int welcomelen = snprintf(welcome, sizeof(welcome),
"Bob, the Text Editor");
if (welcomelen > E.screencols) welcomelen = E.screencols;
;; 100 Days of Clojure Code
;; Day 37: October 21, 2018
;; Interactive Clojure Spec Guide
;; This is a rewrite of the official guide on clojure.org.
;; Edit code blocks and evaluate them with Ctrl+Enter or Command+Return. Even use as a project template!
$ clj -m cljs.main --help
Usage: java -cp cljs.jar cljs.main [init-opt*] [main-opt] [arg*]
With no options or args, runs an interactive Read-Eval-Print Loop
init options:
-co, --compile-opts edn Options to configure the build, can be an EDN
string or system-dependent path-separated list of
EDN files / classpath resources. Options will be
merged left to right.
@bobbicodes
bobbicodes / util.clj
Last active January 13, 2019 18:22
Functions for doing simple math problems
(defn gcd [a b]
(if (zero? b)
a
(recur b (mod a b))))
(defn factors [num]
(loop [n num div 2 divs '()]
(cond (<= n 1) divs
(zero? (rem n div)) (recur (/ n div) div (cons div divs))
:else (recur n (inc div) divs))))
@bobbicodes
bobbicodes / chrome-app
Created January 31, 2019 15:28
Launch a website as an app with no toolbar or tabs
google-chrome --app=https://github.com/