Skip to content

Instantly share code, notes, and snippets.

@popey456963
popey456963 / .bashrc
Last active June 1, 2016 11:52
Bash RC File
# Hey there, this is my ~/.bashrc file. Want to be able to do this cool stuff to? Simply add these lines to your file!
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
@popey456963
popey456963 / alternating.py
Created May 28, 2016 20:06
Alternating Sign Sequence
n,k=int(input()),0
if not n-1%3:k=0
elif not n%3:k=(n/3)+1
else:k=-(n/3)+1
print(k)
"""
Author: Popey456963
Date: 20/05/2016 20:30
Desc: Postcodes
"""
from math import radians, cos, sin, asin, sqrt
AVG_EARTH_RADIUS = 6371
r,n,b=(('M',1000),('CM',900),('D',500),('CD',400),('C',100),('XC',90),('L',50),('XL',40),('X',10),('IX',9),('V',5),
('IV',4),('I',1)),int(input()),""
for c,d in r:
while n>=d:b+=c;n-=d
print b
"""
Author: Popey456963
Date: 20/05/2016 20:10
Desc: Gradients
"""
import turtle
import time
from math import floor
@popey456963
popey456963 / data.log
Created April 5, 2016 13:26
Some Data Logs
172.16.175.1 - - [25/Mar/2016:19:06:13 0000] "GET /login.asp?SessionID=<script>alert(1870)</script> HTTP/1.1" 207
172.16.175.1 - - [25/Mar/2016:19:06:13 0000] "GET /login.asp?message=><script>alert(530)</script> HTTP/1.1" 207
172.16.175.1 - - [25/Mar/2016:19:06:13 0000] "GET /login.asp?target="><script>alert(8238)</script> HTTP/1.1" 207
172.16.175.1 - - [25/Mar/2016:19:06:13 0000] "GET /login.jsp?url="><script type="text/javascript">alert(8714) HTTP/1.1" 207
172.16.175.1 - - [25/Mar/2016:19:06:14 0000] "GET /login.php?Cat=<script>alert(2412)</script> HTTP/1.1" 207
172.16.175.1 - - [25/Mar/2016:19:06:14 0000] "GET /login.php?btag=<script>alert(1542)</script> HTTP/1.1" 207
172.16.175.1 - - [25/Mar/2016:19:06:14 0000] "GET /login.php?category="/><script>alert(9230)</script> HTTP/1.1" 207
172.16.175.1 - - [25/Mar/2016:19:06:14 0000] "GET /login.php?customerEmailAddress="><script>alert(1188)</script> HTTP/1.1" 207
172.16.175.1 - - [25/Mar/2016:19:06:14 0000] "GET /login.php?err=<script>alert(8802)</script
@popey456963
popey456963 / folderScript.py
Created April 5, 2016 13:23
Parse Folder for Specific String
import os
d=os.path.dirname(os.path.realpath(__file__))
dir = [o for o in os.listdir(d) if os.path.isdir(os.path.join(d,o))]
# print(dir)
for i in dir:
carryOn = True
try:
for index,char in enumerate(i):
if "dc-dm____n___D__Js_L__Xs__k-pro_.ha__e.com"[index] != "_":
@popey456963
popey456963 / betterscroll.js
Created April 1, 2016 18:57
Better Auto-scroll
window.setInterval(function() {
var elem = document.getElementById('robinChatWindow');
elem.scrollTop = elem.scrollHeight;
}, 100);
@popey456963
popey456963 / corrections.md
Last active March 6, 2016 21:15
Corrections for Chapter 1

For Loops

for i in range(1, 10):
    print(i)

While Loops

@popey456963
popey456963 / chapter2.md
Created March 4, 2016 09:58
Chapter 2 Modifications
One-dimensional arrays
topScore = 0

for i in x:
    if i > topScore:
        topScore = i

print(topScore)