Skip to content

Instantly share code, notes, and snippets.

View cabreraalex's full-sized avatar
👾

Alex Cabrera cabreraalex

👾
View GitHub Profile
@cabreraalex
cabreraalex / image.py
Last active August 29, 2015 13:56
Attempt at Misc. 200 DEFKTHON CTF 2014
from PIL import Image
import numpy
flag = open("flag.txt")
pixels = flag.read().split("\n")
del pixels[-1]
myPixelsArray = ()
@cabreraalex
cabreraalex / birthday.sh
Created April 15, 2014 14:34
Colorful happy birthday message
#!/bin/bash
red='\e[0;31m'
blue='\e[0;34m'
yellow='\e[0;33m'
green='\e[0;32m'
purple='\e[0;35m'
white='\e[0;37m'
NC='\e[0m'
@cabreraalex
cabreraalex / imagetotext.py
Last active August 29, 2015 14:01
Simple script which reads an image of white and black tiles and converts it into ASCII
from PIL import Image
import binascii
i = Image.open("flag.png")
x = 0
y = 0
answer = ""
for x in range(0,361,20):
! Solarized color scheme for the X Window System
!
! http://ethanschoonover.com/solarized
! Common
#define S_yellow #b58900
#define S_orange #cb4b16
#define S_red #dc322f
@cabreraalex
cabreraalex / adult.csv
Created September 6, 2019 14:22
UCI Adult
We can't make this file beautiful and searchable because it's too large.
age,workclass,education,educational-num,marital-status,occupation,relationship,race,gender,hours-per-week,native-country,income
25,Private,11th,7,Never-married,Machine-op-inspct,Own-child,Black,Male,40,United-States,<=50K
38,Private,HS-grad,9,Married-civ-spouse,Farming-fishing,Husband,White,Male,50,United-States,<=50K
28,Local-gov,Assoc-acdm,12,Married-civ-spouse,Protective-serv,Husband,White,Male,40,United-States,>50K
44,Private,Some-college,10,Married-civ-spouse,Machine-op-inspct,Husband,Black,Male,40,United-States,>50K
18,?,Some-college,10,Never-married,?,Own-child,White,Female,30,United-States,<=50K
34,Private,10th,6,Never-married,Other-service,Not-in-family,White,Male,30,United-States,<=50K
29,?,HS-grad,9,Never-married,?,Unmarried,Black,Male,40,United-States,<=50K
63,Self-emp-not-inc,Prof-school,15,Married-civ-spouse,Prof-specialty,Husband,White,Male,32,United-States,>50K
24,Private,Some-college,10,Never-married,Other-service,Unmarried,White,Female,40,United-States,<=50K
@cabreraalex
cabreraalex / ex.svelte
Last active September 25, 2019 14:30
Simple Svelte example
<script>
let count = 0;
function handleClick() {
count++;
}
</script>
<h1>The count is {count}</h1>
<button on:click={handleClick}>Add to count</button>
from flask import Flask
import random
app = Flask(__name__)
@app.route("/rand")
def hello():
return str(random.randint(0, 100))
if __name__ == "__main__":
<script>
let rand = -1;
function getRand() {
fetch("./rand")
.then(d => d.text())
.then(d => (rand = d));
}
</script>
from flask import Flask, send_from_directory
import random
app = Flask(__name__)
# Path for our main Svelte page
@app.route("/")
def base():
return send_from_directory('client/public', 'index.html')
[{"word": "covered face", "weight": 1, "dists": [1.0, 0.38282279388476614, 0.3361235042716181, 0.7655300124748728, 0.5940753607554056, 0.6919002540403155, 0.7159648718687597, 0.46371801066005697, 0.780836285908319, 0.4807528928982294, 0.553370492921728, 0.45999437445383445, 0.6559477801028842, 0.4994693408383114, 0.7497030392129822, 0.720065946488172, 0.6781960623615415, 0.633537666391945, 0.4386246566457993, 0.5302558342410492, 0.6448172714245405, 0.6805264625220033, 0.4053345392914004, 0.3725375749627701, 0.8809755546554404, 0.496717232044288, 0.44400835104193853, 0.7271345222368581, 0.31719383499757153, 0.4067573541223276, 0.6555576761794705, 0.24093219659929724, 0.49275266568221016, 0.5460153078771401, 0.5320805991870632, 0.46337237307444634, 0.4215108478563876, 0.5290797683008414, 0.5976860627599854, 0.5237560738521613, 0.2846714476971533, 0.6036939790786832, 0.6823788781627457, 0.3628434329357105, 0.6278271860124698, 0.5171533411253912, 0.503553860243585, 0.3275253541838854, 0.49275266568221016]}, {"wor