Skip to content

Instantly share code, notes, and snippets.

View reddraggone9's full-sized avatar

Lee Jenkins reddraggone9

View GitHub Profile
#!/usr/bin/env python3
import requests
url = (
'https://www.reddit.com/r/financialindependence/search.json'
'?q='
'author%3AAutoModerator%20'
'title%3A%22Daily%20FI%20discussion%20thread%22%20'
'&sort=new'
)
@reddraggone9
reddraggone9 / Cargo.toml
Created July 20, 2017 20:58
Post/Redirect/Get vs window.history.replaceState
[package]
name = "rocket-post-redirect"
version = "0.1.0"
authors = ["reddraggone9 <cljenkins9@gmail.com>"]
[dependencies]
rocket = "0.3.0"
rocket_codegen = "0.3.0"
@reddraggone9
reddraggone9 / gist:7ec41d7886fa48f11028
Created April 26, 2015 11:37
A simple demonstration of a one-line, text progress bar in Java.
public class ProgressBar {
public static final char BLANK = '-';
public static final char FILL = '#';
public static final int TOTAL_TIME = 5000;
public static void main(String[] args) throws InterruptedException {
int length = 30;
if(args.length == 1) {
length = Integer.parseInt(args[0]) - 2;
}
@reddraggone9
reddraggone9 / array_size.c
Last active August 29, 2015 14:10
Arrays in C. They are pointers... sometimes.
#include <stdio.h>
int main() {
char *string1[64]; // This should be char (*string1)[64];
char **string2;
printf("%lu\t%lu\n", sizeof *string1, sizeof *string2);
char string3[64];
char *string4;
printf("%lu\t%lu\n", sizeof string3, sizeof string4);
return 0;
Verifying that +reddraggone9 is my openname (Bitcoin username). https://onename.io/reddraggone9
@reddraggone9
reddraggone9 / decaesar.c
Created November 7, 2014 05:01
Prints out all possible caesar cipers of the first argument given.
#include <stdio.h>
int main(int argc, char *argv[]) {
if(argc == 1)
return -1;
char *input = argv[1];
for(int i = 1; i < 26; i++) {
char c;
for(int j = 0; (c = input[j]) != '\0'; j++) {
if('a' <= c && c <= 'z')