Skip to content

Instantly share code, notes, and snippets.

View breadchris's full-sized avatar

Chris breadchris

View GitHub Profile

All the ways to loop

Warmup

Follow the directions in the code. Use the Printing out a grocery list code as a template to write your for loop

Printing out a grocery list

  1. Copy this code into your project
  2. Add your own grocery item to the list
  3. Run the code to see if your grocery item gets printed out
@breadchris
breadchris / thoughts-on-recipes.md
Last active February 8, 2025 13:15
Are recipes hard to follow?

For context, I am building an open source recipe site that addresses the issues that I tend to find people having when attempting a recipe. I would love to hear everyone's thoughts on this topic!

Two years ago, I was using canned chili and soylent as input to my biological computer (ie. I ate food, I didn't make food). Once I was exposed to resources like The Food Lab and SFAH, like many of you here, my life changed. I was repulsed by dishes that were not treated with care, and my mind's eye was opened to this new state of being. Chicken that didn't feel like rubber, eggs that weren't stink bombs, salad that I would actually look forward to eating. I evangelized The Food Lab to my friends and family, I bought them the book and delivered it to them, I did everything short of going to their door and asking "Do you have 10 minutes to talk about our Lord and Savior Kenji Lopez-Alt?". But there was no crispy oven potatoes made, or dead simple spatchcock chicken. Why wouldn't people read this damn book?

I reali

@breadchris
breadchris / export.html
Created March 3, 2020 07:02
pocket backup
<!DOCTYPE html>
<html>
<!--So long and thanks for all the fish-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Pocket Export</title>
</head>
<body>
<h1>Unread</h1>
<ul>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@breadchris
breadchris / 99_problems_26.py
Last active August 20, 2019 00:55
ocaml 99 problems #26 in python
tab_depth = 0
def log(s=None, **kwargs):
global tab_depth
msg = s if s is not None else ", ".join(["{} == {}".format(k, v) for k, v in kwargs.items()])
print("\t" * tab_depth + msg)
def perms(n, l):
global tab_depth
@breadchris
breadchris / gist:deda47c322a3531113ee
Created April 23, 2015 16:00
PicoCTF2014 Hardcore ROP
void randop() {
munmap((void*)0x0F000000, MAPLEN);
void *buf = mmap((void*)0x0F000000, MAPLEN, PROT_READ|PROT_WRITE, MAP_ANON|MAP_PRIVATE|MAP_FIXED, 0, 0);
unsigned seed;
if(read(0, &seed, 4) != 4) return;
srand(seed);
for(int i = 0; i < MAPLEN - 4; i+=3) {
*(int *)&((char*)buf)[i] = rand();
if(i%66 == 0) ((char*)buf)[i] = 0xc3;
}
@breadchris
breadchris / team.md
Created April 3, 2015 06:32
Backdoor CTF 2015 team Writeup

Backdoor CTF 2015 team Writeup

TL;DR

  • Format string

Given that this challenge was 600 points, I expected to be challenged with this one. But with 91 solves I think the people at SDSLabs kinda messed up on the points for this one lol.

Checking out what type of file we were dealing with here:

[~/Documents/CTFs/backdoor]$ file team
@breadchris
breadchris / echo.py
Created April 2, 2015 04:08
Echo server
(lambda s=__import__("socket").socket():s.bind(('',9237))==s.listen(5)==map(lambda c,d:c.send(c.recv(99)),(s.accept()[0]for _ in iter(int,1))))()
@breadchris
breadchris / challenge_6.c
Last active August 29, 2015 14:17
Break repeating-key XOR
//
// challenge_6.c
// Matasano Crypto Challenge
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
char* HEX_LOOKUP = "0123456789abcdef";