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 socket | |
HOST = 'localhost' | |
PORT = 9876 | |
ADDR = (HOST,PORT) | |
BUFSIZE = 4096 | |
videofile = "videos/royalty-free_footage_wien_18_640x360.mp4" | |
bytes = open(videofile).read() |
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
# | |
# writte by joel cornett on my question on stackoverflow for having html links in message boxes | |
# http://stackoverflow.com/questions/13508043/tkinter-tkmessagebox-html-link#comment18491210_13508043 | |
# | |
import re | |
import webbrowser | |
from Tkinter import * | |
class HyperlinkMessageBox(Toplevel): |
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
// Prints objects into json pretty output | |
func PrettyStruct(data interface{}) (string, error) { | |
val, err := json.MarshalIndent(data, "", " ") | |
if err != nil { | |
return "", err | |
} | |
return string(val), nil | |
} | |
// pretty print coded byte in json format |
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
# | |
# | |
# | |
use strict; | |
use warnings; | |
use MIME::Lite; | |
################-- VARIABLES --############################ |
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
example: | |
PRI = 191 | |
To get the Facility | |
Divide the PRI number by 8. | |
191/8 = 23.875 | |
The whole number part is the facility. | |
To get the Severity |
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
<html> | |
<head> | |
<title>moving box - stops/starts on left click</title> | |
<style type='text/css'> | |
#game_region { | |
width: 600px; | |
height: 400px; | |
background-color: black; | |
position:relative; |
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
from gi.repository import Gtk | |
class MyDemoApp(): | |
def __init__(self): | |
window = Gtk.Window() | |
window.set_title("My demo window") | |
window.set_default_size(500, 300) | |
window.set_position(Gtk.WindowPosition.CENTER) |
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
-- | |
-- Table layouts for mydns 1.2.8.11 (Jun 2012) | |
-- Copyright (C) 2002-2005 Don Moore 2007-2008 Howard Wilkinson | |
-- | |
-- You might create these tables with a command like: | |
-- | |
-- $ mydns --create-tables | psql -h HOST -U USER DATABASE | |
-- | |
-- |
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
#!/usr/bin/python3 | |
# writte by David "marvin" Nölte - 2022 | |
# this script reads a file with a list of ip subnets/cirds and outputs it to a ip list | |
# input file can be a list of subnets/one per line | |
# check "./cidr2list.py -h" | |
import os | |
import ipaddress | |
import argparse |
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
// The spritebatch has a draw method that takes in a rotation angle, you can see the overloads for draw here. | |
//First, you would want to get the mouse's location and store it as a vector; | |
MouseState curMouse = Mouse.GetState(); | |
Vector2 mouseLoc = new Vector2(curMouse.X, curMouse.Y); | |
// Next, subtract the mouse's position from the sprite's position to get the direction (as a vector) that the sprite should face and convert it to a angle measured in radians; | |
Vector2 direction = (sprite's position) - mouseLoc; | |
float angle = (float)(Math.Atan2(direction.Y, direction.X)); |
NewerOlder