Skip to content

Instantly share code, notes, and snippets.

View hightemp's full-sized avatar
🎯
Focusing

Anton Panov hightemp

🎯
Focusing
View GitHub Profile
@hightemp
hightemp / java_math_libraries.md
Last active January 21, 2017 05:21
Java mathematics, linear algebra and optimisation libraries
@hightemp
hightemp / web-servers.md
Created May 1, 2017 01:58 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@hightemp
hightemp / twisted_server.py
Last active May 8, 2017 08:54 — forked from chris-piekarski/multi_thread_web_server
[Python] [Twisted] Mini web-server
from twisted.web import server, resource
from twisted.internet import reactor, endpoints
class Counter(resource.Resource):
isLeaf = True
numberRequests = 0
def render_GET(self, request):
self.numberRequests += 1
request.setHeader("content-type", "text/plain")
@hightemp
hightemp / pyglet_app.py
Last active May 8, 2017 08:55
[Python] [OpenGL] Example of usage pyglet, pywavefront and OpenGL on python
#!/usr/bin/python
# -*- coding: UTF8 -*-
from os.path import *
import pyglet
from pyglet.gl import *
from pyglet.window import *
import pywavefront
import math
@hightemp
hightemp / twisted_server.py
Last active May 8, 2017 08:50
[Python] [Twisted] Mini web-server on twisted
#!/usr/bin/python
# -*- coding: UTF8 -*-
if __name__=="__main__":
from twisted.web.server import *
from twisted.web.resource import *
from twisted.internet import *
from twisted.internet import reactor
from twisted.web.error import *
from os.path import *
@hightemp
hightemp / gevent_server.py
Last active May 8, 2017 08:51
[Python] [Gevent] Server based on gevent
import gevent
def fnServer(port):
from gevent import socket
s = socket.socket()
s.bind(('0.0.0.0', port))
s.listen(500)
while True:
cli, addr = s.accept()
gevent.spawn(handle_request, cli, gevent.sleep)
@hightemp
hightemp / SObserver.java
Last active May 7, 2017 17:09
[JAVA] [Patterns] Simple observer pattern class
import java.lang.*;
import java.lang.reflect.*;
import java.util.*;
public static class SObserver {
protected static HashMap<String, Object> hmMethodsObjects = new HashMap<String, Object>();
protected static HashMap<String, Method> hmMethods = new HashMap<String, Method>();
protected static HashMap<String, String> hmListeners = new HashMap<String, String>();
@hightemp
hightemp / GoPro RTMP streaming with FFmpeg
Created May 7, 2017 04:11 — forked from laurieainley/GoPro RTMP streaming with FFmpeg
Live streaming from a GoPro Hero3 camera to RTMP server using FFmpeg
Basic Requirements:
Computer with wired and wireless connection
FFmpeg installation: http://www.ffmpeg.org/
GoPro Hero 3+: http://gopro.com/
RTMP server e.g. FMS (http://www.adobe.com/products/adobe-media-server-family.html) or CDN ingest point
Overview:
GoPro Hero3 cameras produce HLS streams which are consumed by control apps and their removeable monitor.
@hightemp
hightemp / base64_encoder.py
Last active May 8, 2017 17:01
[Python] [Base64] Encode files into base64 and saves into sTempDir mirror
import base64
import os
from os.path import *
aDirectories = ['templates', 'assets']
sCurrentDir = os.path.dirname(os.path.abspath(__file__))
sTempDir = join(sCurrentDir, 'temporary')
def fnEcodeFilesInDir(in_sCurrentPath, in_sTempPath):
@hightemp
hightemp / socket_server.py
Last active May 8, 2017 08:52
[Python] [Socket] [Thread] Example of thread socket server
def fnServer(port):
s = socket.socket()
s.bind(('0.0.0.0', port))
s.listen(500)
while True:
cli, addr = s.accept()
t = threading.Thread(target=handle_request, args=(cli, time.sleep))
t.daemon = True
t.start()