Skip to content

Instantly share code, notes, and snippets.

View JasonSpine's full-sized avatar
🕹️
GameDev

Marek Adamczyk JasonSpine

🕹️
GameDev
View GitHub Profile
@JasonSpine
JasonSpine / mp3s_overall_time.py
Created January 23, 2017 09:02
Get overall time of all mp3s in the current directory
import os,commands,re
path = './' # the directory path to calc
listing = os.listdir(path) # list all files
result=0 # result [seconds]
for i in listing:
if i[-4:].lower()==".mp3": # check the file extension
command = "ffmpeg -i '%s' 2>&1 | grep Duration"%i
durationString=commands.getoutput(command)
@JasonSpine
JasonSpine / rect_integral.py
Created January 23, 2017 09:03
Integral - rectangle method
#python < 3.0
import math
x=1.0 #starting argument
dx=0.0001 #delta
result=0.0
while x<=200.0: #ending argument
x+=dx
fx=1.0/x #integrable function
result+=dx*fx
@JasonSpine
JasonSpine / mts2avi.py
Created January 23, 2017 09:06
Convert HD Camcorder *.MTS films with avconv
# -*- coding: utf-8 -*-
import os
path = './'
listing = os.listdir(path)
for infile in listing:
s=os.getcwd()+'/'+infile.split('.MTS')[0]
command="""avconv -i '%s.MTS' -r 30 -vcodec mpeg4 -acodec libmp3lame\
@JasonSpine
JasonSpine / mts2avi_ffmpeg.py
Created January 23, 2017 09:07
Convert HD Camcorder *.MTS films with FFmpeg
# -*- coding: utf-8 -*-
import os
path = './'
listing = os.listdir(path)
for infile in listing:
s=os.getcwd()+'/'+infile.split('.MTS')[0]
command="""ffmpeg -i '%s.MTS' -r 30 -vcodec mpeg4 -acodec libmp3lame\
@JasonSpine
JasonSpine / extract_eml_attachments.py
Created January 23, 2017 09:08
Extract all attachments of *.eml files
import email
import os
path = './'
listing = os.listdir(path)
for fle in listing:
if str.lower(fle[-3:])=="eml":
msg = email.message_from_file(open(fle))
attachments=msg.get_payload()
This file covers Privacy Policy for a product that is available on Google Play:
Photogenic Rider
by JGD Marek Adamczyk
https://play.google.com/store/apps/details?id=com.JGD.PhotogenicRider
I. Camera
This application uses device camera to take a photo of user's face.
@JasonSpine
JasonSpine / Atan360.cs
Last active April 26, 2018 00:29
Unity C# Atan360 degrees
public class MyMath {
float atan360(float y, float x) {
float result = Mathf.Atan2 (y, x) * Mathf.Rad2Deg;
if (result < 0.0f) {
return result + 360.0f;
}
return result;
}
}
@JasonSpine
JasonSpine / dosbox.conf
Last active September 5, 2018 15:19
Origin's Windowed Dungeon Keeper Dosbox Config - you may want to edit windowresolution
# Lines starting with a # are commentlines.
# They are used to (briefly) document the effect of each option.
[sdl]
# fullscreen -- Start dosbox directly in fullscreen.
# fulldouble -- Use double buffering in fullscreen.
# fullresolution -- What resolution to use for fullscreen: original or fixed size (e.g. 1024x768).
# windowresolution -- Scale the window to this size IF the output device supports hardware scaling.
# output -- What to use for output: surface,overlay,opengl,openglnb,ddraw.
# autolock -- Mouse will automatically lock, if you click on the screen.
@JasonSpine
JasonSpine / 7BH_51_speed.code
Created September 7, 2018 12:36
7 Billion Humans | Year 51 | Speed
-- 7 Billion Humans (2087) --
-- 51: Identify Yourselves --
step s
pickup c
if w == nothing:
mem1 = set 1
write 1
drop
end
@JasonSpine
JasonSpine / 7BH_51_size.code
Created September 7, 2018 12:38
7 Billion Humans | Year 51 | Size
-- 7 Billion Humans (2087) --
-- 51: Identify Yourselves --
step s
pickup c
a:
if w == nothing or
w == datacube:
mem1 = calc w + 1
write mem1