Skip to content

Instantly share code, notes, and snippets.

View levicole's full-sized avatar

Levi Cole levicole

  • Kolide
  • Nashville, TN
View GitHub Profile
#!/bin/bash
set -eo pipefail
json="{}"
while test $# != 0
do
case "$1" in
--env-var1=*)
setcps 0.56
d1 $ stack [
rarely ( stutWith 2 (0.125) (|* gain 0.9) )
$ every 16 (|* speed "-1" )
$ s "808bd:2*4"
, sometimesBy 0.25 (stutWith 8 (0.125/4) ((# lpf 100) . (|* gain 0.9)))
$ s "808bd:3(3,8)"
, slow 64
$ striateBy 64 (1/128)
@levicole
levicole / dynamic-array.c
Created July 19, 2020 23:10
dynamic array thing
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
// I have no idea if this is a good idea, or a bad idea?
typedef enum {
K_STRING,
K_INT,
K_COMPLEX
@levicole
levicole / updates.css
Created November 7, 2017 02:12
Helping Keith with some CSS!
// I'd make sure you do this in a media query of some form so it only happens on mobile.
nav {
width: 80%;
}
nav ul li {
width: 20%;
text-align: center;
}
@levicole
levicole / main.rs
Created August 10, 2017 15:39
Watch output of tail in rust
use std::process::{Command, Stdio, ChildStdout};
use std::io::{Read};
use std::thread;
use std::str;
fn main() {
let mut command = Command::new("/usr/bin/tail");
command
.arg("-f")
.arg("/var/log/system.log")
@levicole
levicole / colorize.rb
Created August 4, 2017 00:31
Random Color Printer
text = ARGV
colorized = text.map do |word|
r = rand(256)
g = rand(256)
b = rand(256)
"\x1b[38;2;#{r};#{g};#{b}m#{word}\x1b[0m"
end.join(" ")
@levicole
levicole / chicken-tikka-masala.md
Created July 21, 2017 14:59
Crock Pot Chicken Tikka Masala

Chicken Tikka Masala

  • 1.5-2 lbs of boneless skinless chicken breasts (or thighs if you prefer)
  • 1 large onion, diced
  • 4 cloves of garlic, minced
  • 2 tbsp. fresh ginger, minced (sub 1/4 tsp of ground ginger if needed)
  • 1 28 oz can of tomato sauce
  • 1 14oz can of diced tomatoes (drained)
  • 2 tbsp of tomato paste (or just one whole small can)
  • 2 tbsp. olive oil
  • 2 tbsp. Garam masala
extern crate termion;
use std::io::{Write, Stdout, Stdin, stdout, stdin};
use termion::cursor;
use termion::event::{Key, Event};
use termion::input::TermRead;
use termion::raw::{IntoRawMode, RawTerminal};
use termion::screen::AlternateScreen;
pub struct Editor<'a> {
@levicole
levicole / image.rb
Created May 17, 2017 19:34 — forked from seancdavis/image.rb
Rails has_many :through Polymorphic Association (http://goo.gl/lxmehk)
# app/models/image.rb
class Image < ActiveRecord::Base
has_many :taggings, :as => :taggable
has_many :tags, :through => :taggings
end
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="https://code.jquery.com/jquery-3.0.0.js"></script>
</head>
<body>
<h1>My Awesome ToDo List</h1>