Skip to content

Instantly share code, notes, and snippets.

View vesche's full-sized avatar
🛸
I WANT TO BELIEVE

Austin Jackson vesche

🛸
I WANT TO BELIEVE
View GitHub Profile
@vesche
vesche / nested_attr.py
Created January 1, 2019 21:02
Nested attributes
class A:
def __init__(self):
self.b = B()
@property
def f1(self):
return self.b
class B:
def __init__(self):
import numpy as n
def s(x):return 1.0/(1+n.exp(-x))
def d(x):return x*(1.0-x)
class N:
def __init__(self,x,y):self.x,self.y=x,y;self.w1,self.w2,self.o=n.random.rand(self.x.shape[1],4),n.random.rand(4,1),n.zeros(self.y.shape)
def f(self):self.l1=s(n.dot(self.x,self.w1));self.o=s(n.dot(self.l1,self.w2))
def b(self):r=n.dot(self.l1.T,(2*(self.y-self.o)*d(self.o)));q=n.dot(self.x.T,(n.dot(2*(self.y-self.o)*d(self.o),self.w2.T)*d(self.l1)));self.w1+=q;self.w2+=r
X=n.array([[0,0,1],[0,1,1],[1,0,1],[1,1,1]]);y=n.array([[0],[1],[1],[0]]);a=N(X,y)
for i in range(1500):a.f();a.b()
print(a.o)
@vesche
vesche / rename.py
Created June 25, 2018 21:45
Incoming rename script
#!/usr/bin/env python
"""
quick incoming rename script
"""
import os
for f in os.listdir('.'):
if not os.path.isdir(f) or '_' in f:
@vesche
vesche / autogamble.py
Created June 18, 2018 05:59
autogamble.py
#!/usr/bin/env python
import pyautogui
import random
import time
def r(): return random.randint(1, 10)
while 1:
time.sleep(r())
@vesche
vesche / mass_rename.py
Created June 14, 2018 03:38
library quality mass rename
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
hacky mass rename with quality
let's hope this doesn't fuck up
"""
import os
@vesche
vesche / deluge_theme_note.md
Created April 9, 2018 22:03
Deluge Dark Theme

Dark Deluge Theme on Arch Linux

sudo pacman -S deluge pygtk

DelugeSimpleDark Theme: http://fav.me/dblwxeh

$ unzip theme.zip
@vesche
vesche / frontsidefix.py
Created February 26, 2018 18:32
frontsidefix
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
#
# frontsidefix
# https://github.com/vesche
#
import argparse
import os
@vesche
vesche / pygame_raycaster.py
Created November 14, 2017 00:39
pygame raycaster
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# pygame raycaster proto
#
import math
import time
import pygame
sudo date -s "$(wget -qSO- --max-redirect=0 google.com 2>&1 | grep Date: | cut -d' ' -f5-8)Z"
@vesche
vesche / day07_part1.py
Created December 10, 2016 15:44
AoC 2016 Day 7 Part 1
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
######################################
# Advent of Code 2016, Day 07 - Part 1
# https://github.com/vesche
######################################
import re