Skip to content

Instantly share code, notes, and snippets.

View taddeimania's full-sized avatar
☄️
Hi!

Joel Taddei taddeimania

☄️
Hi!
View GitHub Profile
@taddeimania
taddeimania / pickle_rick.py
Created August 14, 2017 01:39
I'M PYTHON PICKLE RICK!!!!
import pickle
class Rick:
def __str__(self):
return "i'm pickle rick!!!!"
pickle_rick = pickle.dumps(Rick())
regular_rick = pickle.loads(pickle_rick)
print(regular_rick)
# >>> i'm pickle rick!!!!
echo "Joel likes coding"
echo "I just edited"
exit
<script type="application/javascript">
$( document ).ready(function() {
var callAgain = function(stuff){
// Do work here
// Why not make an ajax call and replace an element on the page?
// Delay another call in 10 seconds
setTimeout(function(){
callAgain(stuff);
@taddeimania
taddeimania / hello_html.bf
Created April 2, 2016 02:07
Hello World in BF That outputs a webpage.
+++[>++++++[>+++>++++>+++++>++++++>++++++>+++++++<<<<<<-]<-]>>
++++++.>>>----.>++++++++.<+++++.-.<<<++.
<<++++++[>++<-]>+.----.---------<
>>--.>>>----.---.----.+++.<<<++.
<<++++++[>++<-]>+.----..---------<
>>--.>>>>.<+++++.>.<+++.-------.<<<++.
++++.>>>>--.<----.++++++++.+++++.<<--.<<<
+++++[>+++++++++<-]>..>>>>---.<<<------.<++.
>>>>>++.<--.>.<+++.-------.<<<++.
<[-]<++++++[>++<-]>+.----.>--.<[<+++++>-]<++.
++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>
.>-------.+++++++++++++++..+++++++++.>>.
<<<-------.>---------.++.---------.+++.>>.
<<<+++++.>+++..---.+++++++.>>.
<<<--.>>+++++++++.<++++++.>>+.>+++++.
<<+++++++++.<-----.>---------.+++..+.++++.
<<----.>>--.++++++.
<<<++++[>>>---<<<-]>>>.++++++++.+++.
<<<++++[>>>>+++<<<<-]>>>>+.
<---------.<-----.--.
# Find day of the week in python 3
from enum import Enum
class DayOfWeek(Enum):
Sunday = 0
Monday = 1
Tuesday = 2
Wednesday = 3
@taddeimania
taddeimania / butts.bs
Last active November 24, 2015 03:48
heh
10 PRINT "fart"
20 GOTO 10
@taddeimania
taddeimania / wat.py
Created November 14, 2015 00:52
Object + Function = Hello World!
class Number(int):
def __add__(self, fn):
return fn(self)
Number(5) + (lambda x: print("hello world"))
@taddeimania
taddeimania / euclideanDistance.js
Created October 28, 2015 20:25
Calculate the distance between two feature vectors.
function euclideanDistance(v1, v2) {
return v1.map(
(e, i) => [v1[i], v2[i]]
).map(
(a) => a.reduce(
(prev, cur) => prev - cur
)
).map(
(e) => e ** 2
).reduce(
@taddeimania
taddeimania / hashing.py
Created October 27, 2015 17:53
MD5 hashing
import md5
m = md5()
m = md5(b"http://joel.io")
m.hexdigest()
# >> 'c9bd9363c90e6a3a7edd3f5114bfffd2'
m.hexdigest()[:10]
# >> 'c9bd9363c9'