Skip to content

Instantly share code, notes, and snippets.

View EliseAv's full-sized avatar

Elise Avila EliseAv

  • Toronto, Canada
  • 04:25 (UTC -04:00)
View GitHub Profile
@EliseAv
EliseAv / fightluna.py
Last active September 20, 2015 03:52
Beat Luna in “Banned From Equestria Daily” (by pokehidden) on your Mac. :P
#!/usr/bin/python
# -*- coding: utf-8 -*-
from random import random
from sys import argv, exit
from time import sleep
from Quartz.CoreGraphics import CGEventCreateMouseEvent, kCGMouseButtonLeft, CGEventPost, kCGHIDEventTap, kCGEventMouseMoved, kCGEventLeftMouseDown, kCGEventLeftMouseUp, CGEventCreate, CGEventGetLocation
from Quartz import NSResponder
def fight_luna(attack):
try:
@EliseAv
EliseAv / renmd5.py
Created September 20, 2015 03:49
Make sure files are named after their hashes.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2015, Ekevoo.com.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@EliseAv
EliseAv / guid22chars.py
Last active March 2, 2016 05:54
Guid/UUID on 22 characters using base57
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
# means.
#
@EliseAv
EliseAv / Internal References Test.rst
Last active August 6, 2016 04:17
Internal References Test

Let's make references to a Title, a normal target, and an inline target.

Title

This paragraph is the normal target.

This paragraph contains an inline target.

( •_•)
( •_•)>⌐■-■
(⌐■_■)
@EliseAv
EliseAv / paperclipsHelper.js
Last active May 13, 2020 22:30
Paperclips Helper
/*
Copyright 2017 Ekevoo
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@EliseAv
EliseAv / calc1.py
Last active January 1, 2018 23:46
Factorio Rates
from collections import namedtuple
from fractions import Fraction
from functools import partial
from itertools import chain
from math import log, floor
class FractionDict(dict):
zero = Fraction()
@EliseAv
EliseAv / cfic
Created April 21, 2018 04:25
Console full image color
#!/usr/bin/env python3
"""
Console full image color
Usage: ./cfic image.png
Any image format supported by Pillow will work.
Make sure the image is small. Width of 80 pixels is ideal.
Keep in mind that console blocks aren't usually 1:2 exactly, and the
@EliseAv
EliseAv / continued_fraction.py
Created January 29, 2019 19:12
Continued Fraction
from fractions import Fraction as F
from math import floor, pi
def to_cf(value):
head = floor(value)
value = F(value - head)
parts = [head]
while value:
value = F(1, value)
@EliseAv
EliseAv / deduplicator.py
Last active August 5, 2019 21:09
file deduplicator
#!/usr/bin/python3
#
# MIT License
#
# Copyright (c) 2019 Ekevoo.com
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell