Skip to content

Instantly share code, notes, and snippets.

View bitoffdev's full-sized avatar
🇺🇸

Elliot bitoffdev

🇺🇸
View GitHub Profile
memo = {1:1}
def fact(n):
global memo
if not n in memo:
if n > max(memo) + 500:
fact(min(n, max(memo)+500))
memo[n] = n * fact(n-1)
return memo[n]
if __name__ == "__main__":
@bitoffdev
bitoffdev / filedownloader.py
Last active March 26, 2025 06:52
filedownloader.py
# Python file downloader for Pythonista by OMZ Software
# By: EJM Software ---- http://ejm.cloudvent.net
# Source: https://gist.github.com/89edf288a15fde45682a
# *****************************************
# This simple script uses the requests module to download files
# and the ui module to show a progress bar
# You can use this bookmarklet to download files from Safari:
# javascript:window.location='pythonista://filedownloader?action=run&argv='+encodeURIComponent(document.location.href);
import ui, console, clipboard, sys, requests, zipfile
@bitoffdev
bitoffdev / Markdown Editor.py
Last active August 29, 2015 14:05
Markdown Editor.py
# Pythonista Markdown Editor
# By: EJM Software ---- http://ejm.cloudvent.net
# Source: http://gist.github.com/02df085647247a815eff
# *****************************************
import ui, console, editor, markdown, webbrowser, urllib
@ui.in_background
def new_md(sender):
filename = console.input_alert('', 'File Name')
if filename.find('.')>-1:
import requests, datetime, pytz
class AssetStoreException (Exception):
pass
class AssetStoreClient(object):
LOGIN_URL = 'https://publisher.assetstore.unity3d.com/login'
LOGOUT_URL = 'https://publisher.assetstore.unity3d.com/logout'
SALES_URL = 'https://publisher.assetstore.unity3d.com/sales.html'
USER_OVERVIEW_JSON_URL = 'https://publisher.assetstore.unity3d.com/api/user/overview.json'
@bitoffdev
bitoffdev / MarkdownMenu.py
Created January 3, 2015 02:31
MarkdownMenu.py
# Pythonista Markdown Action Menu
# By: EJM Software ---- http://ejm.cloudvent.net
import ui, console, editor, markdown
def format_italic():
s = editor.get_selection()
if not s==None and s[1]-s[0]>0:
editor.replace_text(s[0], s[1], '*%s*'%editor.get_text()[s[0]:s[1]])
def format_bold():
#include <avr/pgmspace.h> // allows use of PROGMEM
#define CUBESIZE 4
#define PLANESIZE CUBESIZE*CUBESIZE
#define PLANETIME 100 // time each plane is displayed in us -> 100 Hz refresh
#define TIMECONST 20 // multiplies DisplayTime to get ms
// store LED Pattern Table in PROGMEM
// last column is display time in 100ms
const char PROGMEM PatternTable[] = {
import wave
import matplotlib.path as mpath
import matplotlib.patches as mpatches
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
Path = mpath.Path
path_data = []
###############################################################################
##### INSTALL ROS KINETIC #####################################################
###############################################################################
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 0xB01FA116
sudo apt-get update
sudo apt-get install -y ros-kinetic-ros-base
sudo rosdep init
rosdep update
@bitoffdev
bitoffdev / print_binary.asm
Created October 25, 2017 17:06
MIPS print a 32-bit register as binary
#
# FILE: print_binary.asm
# AUTHOR: Elliot Miller, 2017
#
###############################################################################
.data
newline_string: .asciiz "\n"
#
# Name: print_binary
@bitoffdev
bitoffdev / guess.asm
Created November 15, 2017 06:57
obfuscated MIPS number guessing game
.text
mont: li $v0,4
la $a0,d
syscall
jr $ra
.data
a:.byte 71,117,101,115,115,32,97,32,110,117,109,98,101,114,58,32,0
bb:.byte 84,111,111,32,104,105,103,104,58,32,0
.text
awsq:li $v0,4