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 / queue_socket_server.py
Last active May 8, 2017 17:00
[Python] [Socket] [Queue] Example of sockets server
def fnServer(port, N=10):
s = socket.socket()
s.bind(('0.0.0.0', port))
s.listen(500)
q = Queue()
for x in xrange(N):
t = threading.Thread(target=fnThreadWorker, args=(q,))
t.daemon = True
t.start()
print 'Ready and waiting with %d threads on port %d' % (
@hightemp
hightemp / public_ip.py
Last active June 7, 2017 03:51
[Python] Example of getting public IP-address
"""
Currently there are several options:
ip.42.pl
jsonip.com
httpbin.org
ipify.org
Below are exact ways you can utilize each of the above.
"""
@hightemp
hightemp / minifier.rb
Created May 15, 2017 19:12
[Ruby] Image minifier
#!/usr/bin/env ruby
fail "[E] Usage:\n\r ruby DIR_NAME <NOP option>\n\r" unless ARGV.first
puts "[!] Processing images\n\r"
count = 0
sDirectoryName = ARGV.first
objDirectory = Dir["#{sDirectoryName}/**/*.{jpg,jpeg,JPG,JPEG,png,PNG}"] # jpg,jpeg,JPG,JPEG, png,PNG
@hightemp
hightemp / library.js
Last active May 29, 2017 17:03
[JavaScript] Library
'use strict';
(function() {
window.objLibrary = {
"TBitArray": function() {
this.prototype = {
"aBits": [],
@hightemp
hightemp / shortening.md
Last active May 9, 2019 19:51
Сокращения

Файлы и папки

[shortening]FileName

  • _ - директория, содерержащая другие директории
  • doc - документация, справочник
  • lib - библиотека
  • app - приложение
  • mapp - мобильное приложение
  • capp - консольное приложение
@hightemp
hightemp / angle-between-points.js
Created June 2, 2017 05:24 — forked from conorbuck/angle-between-points.js
[JavaScript] Find the angle between two points
var p1 = {
x: 20,
y: 20
};
var p2 = {
x: 40,
y: 40
};
@hightemp
hightemp / python-icon-icns.sh
Last active June 3, 2017 03:29 — forked from andreif/python-icon-icns.sh
[Bash] Convert images to icon set
#!/usr/bin/env bash
# -----------------------------------------------------------------------------
# 1. Download SVG
if [ ! -f logo.svg ]; then
curl https://www.python.org/static/community_logos/python-logo-inkscape.svg > logo.svg
fi
# -----------------------------------------------------------------------------
@hightemp
hightemp / 32.asm
Last active June 6, 2017 05:54 — forked from FiloSottile/32.asm
[Assembler][NASM] Hello World for x86 and x86_64 Intel Mac OS X(get yourself an updated nasm with brew)
; /usr/local/bin/nasm -f macho 32.asm && ld -macosx_version_min 10.7.0 -o 32 32.o && ./32
global start
section .text
start:
push dword msg.len
push dword msg
push dword 1
mov eax, 4
@hightemp
hightemp / appInternetInfo.py
Last active June 7, 2017 04:59
[Python] Tray informer (Internet access, Geo, IP)
#!/usr/bin/python
# -*- coding: UTF8 -*-
import geoip as mGeoIP
import wx as mWX
import urllib2 as mURLLib2
import copy as mCopy
import re as mRegularExpression
import threading as mThreading
@hightemp
hightemp / StatusIcon.py
Last active June 7, 2017 05:25 — forked from pklaus/StatusIcon.py
[Python][GTK] StatusIcon – A Simple Tray Icon Application Using PyGTK
#!/usr/bin/env python
# found on <http://files.majorsilence.com/rubbish/pygtk-book/pygtk-notebook-html/pygtk-notebook-latest.html#SECTION00430000000000000000>
# simple example of a tray icon application using PyGTK
import gtk
def message(data=None):
"Function to display messages to the user."