Skip to content

Instantly share code, notes, and snippets.

View judah-caruso's full-sized avatar
🎯
Focusing

Judah Caruso judah-caruso

🎯
Focusing
View GitHub Profile
/*
Simple program that treats a C/C++ source
file *as* the build script. This is the
step between: compiling a source file
directly, and creating a build script.
License: MIT
@build.cc clang
@build.out build
@judah-caruso
judah-caruso / state_machine.c
Last active May 5, 2020 09:50
StateyMcStateMachines
#include <stdio.h>
typedef struct {
int counter;
} StateMachine;
typedef void* (State)(StateMachine*);
State*
second_State(StateMachine* state_machine)
@judah-caruso
judah-caruso / theme-definitions.4coder
Last active February 3, 2023 03:15
A file containing 4coder theme definitions and their descriptions
// This file contains each 4coder theme definition and what it does within the editor.
// Main editor
defcolor_back = 0xFF000000; // Main buffer background
defcolor_text_default = 0xFFFFFFFF; // Default character foreground
defcolor_at_cursor = 0xFF000000; // Cursor foreground
defcolor_cursor = {0xFF000000, 0xFF000000}; // [0] Cursor background, [1] Active macro recording cursor background
defcolor_mark = 0xFF000000; // Mark background
defcolor_highlight_cursor_line = 0xFF000000; // Current line background
defcolor_margin_active = 0xFF000000; // Active buffer outline
(setq cmd-char ?!) ;; the leader for our commands '!'
(defun show-commands ()
(print "ran !commands"))
;; take a string input (what the twitch user types)
;; and look for a '!' + one of our commands.
(defun run-command (input)
;; get the 0th character from our string and compare it to '!'
(if (eq cmd-char (aref input 0))
<!-- This theme is loosely based off of Jonathan Blow's emacs theme -->
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!-- Generated by: TmTheme-Editor -->
<!-- ============================================ -->
<!-- app: http://tmtheme-editor.herokuapp.com -->
<!-- code: https://github.com/aziz/tmTheme-Editor -->
<plist version="1.0">
<dict>
@judah-caruso
judah-caruso / convert_code_to_htmlent.lobster
Last active April 7, 2019 03:54
Takes a string of code and converts each special character to HTML entities.
import std
// should cover the main "problematic" characters
def char_to_entity(char):
return switch(char):
case "|" : "&vert;"
case "_" : "&lowbar;"
case ";" : "&semi;"
case "#" : "&num;"
case "-" : "&dash;"
int fib(n) |
if n <= 1 ? return x : return fib(n-1) + fib(n-2)
string concat(x, y) | return (string) x + y
vector loopTest(n) |
i = 0, ret_vec = [] |
for i != n : ret_vec[i] = i * 2, i++ >> return ret_vec
vector tokenStream = []
wget https://dl.google.com/go/go1.12.darwin-amd64.tar.gz
tar -C /usr/local -xvf go1.12.darwin-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin
go get -u github.com/mum4k/termdash
cd $HOME/go/pkg/mod/github.com/mum4k/termdash/termdash@v0.7.2/termdashdemo
var numTweets = parseInt(document.querySelector("[data-count]").innerHTML.replace(/\s+/, ""));
function deleteTweet() {
document.getElementsByClassName("ProfileTweet-actionButton")[0].click();
document.getElementsByClassName("js-actionDelete")[0].click();
document.getElementsByClassName("delete-action")[0].click();
}
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
function fizz_buzz(num)
{
if (num % 15 == 0) {
console.log("FizzBuzz");
} else if (num % 5 == 0) {
console.log("Buzz");
} else if (num % 3 == 0) {
console.log("Fizz");
} else {
console.log(num);