Skip to content

Instantly share code, notes, and snippets.

View kennycason's full-sized avatar

Kenny Cason kennycason

View GitHub Profile
@kennycason
kennycason / gist:e37db69a23844911157e741ea4e53926
Created February 6, 2024 01:13
Brenden Dilley Terroristic Threat for FBI
"So you better pray to god, and I mean this literally, or whoever the fuck it is you pray to, that Donald J Trump, the President of the United State, and AG Barr clean this up lawfully. Because if for any reason the president of the United State is feeling that it’s not getting done as it should, decides to put out the tweet that says my fellow Americans my fellow 2A loving Americans it's time to take up arms against these assholes you are all fucked in under an hour under 1 hour you're done every one of you we're all just at home hanging out or we're on vacation like me right now watching you idiots behave the way you do waiting for that one tweet that one emergency text message from the fucked president of the United States that gives us the green light to finish this entire thing in under an hour it will not be law enforcement it will not be one of these slow bureaucratic justice system wheels of Justice turning it'll be a group of people you didn't even know fucked existed because we were at our house, we
@kennycason
kennycason / ParallelStreamSaturationTest.java
Created September 20, 2016 18:25
Demonstrate Java Parallel streams fall back to main thread in the event that all workers in common fork join pool are saturated.
package com.simplymeasured.gus.controller;
import java.util.Arrays;
/**
* Created by kenny on 9/20/16.
*
* Demonstrate Java Parallel streams fall back to main thread in the event that all workers in common fork join pool
* are saturated.
*/
@kennycason
kennycason / .zshrc
Last active June 25, 2020 04:17
TODO.sh
# settings to get working in zsh
autoload bashcompinit
bashcompinit
setopt localoptions rmstarsilent
setopt +o nomatch
source ~/todo.sh
@kennycason
kennycason / BinarySearch.kt
Last active May 14, 2020 05:32
Binary Search in Kotlin (Iterative and Recursive)
object BinarySearch {
/**
* @Param begin inclusive
* @Param end inclusive
*/
fun search(needle: Int, haystack: Array<Int>): Int {
if (haystack.isEmpty()) {
return -1
}
@kennycason
kennycason / BinaryFileInputFormat.java
Created January 3, 2019 21:58
Hadoop IO - BinaryFileInputFormat
package com.kennycason.hadoop.io;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.mapreduce.*;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
/** An {@link InputFormat} for reading binary data (byte[]) */
public class BinaryFileInputFormat extends FileInputFormat<NullWritable, ImmutableBytesWritable> {
@kennycason
kennycason / getMonthExample1.js
Last active April 7, 2018 18:22
getMonth.js (example)
function monthName() {
switch (new Date().getMonth()) {
case 0:
return "January";
case 1:
return "February";
case 2:
return "March";
case 3:
return "April";
print("hello, world")
# list
friends = ['john', 'pat', 'gary', 'michael']
print(len(friends))
for f in friends:
print("hello " + f)
# map / dictionary
friends2 = {
@kennycason
kennycason / README.md
Created November 23, 2017 02:25
Simple C++ Mudd

Run

g++ main.cpp chmod +x a.out ./a.out

@kennycason
kennycason / lrss.py
Created August 9, 2017 23:24
Longest Repeated SubString
def lrss(s):
slen = len(s)
for l in range(slen - 1, 1, -1): # the length of the string, go from max to min, decrementing range
print "l=" + str(l)
# there is a bit of redundancy in the i/j iterations as they double check each other
# e.g. when i < j and j > i
for i in range(0, slen - l + 1): # tracks position of the iterations
print " i=" + str(i)
for j in range(0, slen - l + 1): # tracks position of the iterations
if i == j: continue # if i == j , then it's the same index in the string
@kennycason
kennycason / Banana.java
Last active August 7, 2017 23:26
Banana
public class Banana {
public static void main(final String[] args) {
assert contains("banana", "b");
assert contains("banana", "ana");
assert contains("banana", "na");
assert contains("banana", "banana");
assert !contains("banana", "gx");
assert !contains("banana", "");
assert !contains("", "ana");