Skip to content

Instantly share code, notes, and snippets.

View hightemp's full-sized avatar
🎯
Focusing

Anton Panov hightemp

🎯
Focusing
View GitHub Profile

Port Forwarding in Mavericks


Since Mavericks stopped using the deprecated ipfw (as of Mountain Lion), we'll be using pf to allow port forwarding.

####1. anchor file Create an anchor file under /etc/pf.anchors/<anchor file> with your redirection rule like:

@hightemp
hightemp / jquery.extend.js
Created May 24, 2012 12:26 — forked from tanepiper/jquery.extend.js
jQuery extend for NodeJS / Object & Array Deep Copy for NodeJS
/*
jQuery.extend extracted from the jQuery source & optimised for NodeJS
Twitter: @FGRibreau / fgribreau.com
Usage:
var Extend = require('./Extend');
// Extend
var obj = Extend({opt1:true, opt2:true}, {opt1:false});
@hightemp
hightemp / http_authentication
Created November 11, 2012 18:42 — forked from ipoval/http_authentication
Http basic authentication for padrino
module HttpAuthentication
module Basic
def authenticate_or_request_with_http_basic(realm = 'Application')
authenticate_with_http_basic || request_http_basic_authentication(realm)
end
def authenticate_with_http_basic
if auth_str = request.env['HTTP_AUTHORIZATION']
return 'login:password' == ActiveSupport::Base64.decode64(auth_str.sub(/^Basic\s+/, ''))
end
#!/bin/bash
# Script to convert PDF file to JPG images
#
# Dependencies:
# * pdftk
# * imagemagick
PDF=$1
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
  1. Setup ejabber ================ ejabberd is a free and open source instant messaging server written in Erlang/OTP.

ejabberd is cross-platform, distributed, fault-tolerant, and based on open standards to achieve real-time communication.

ejabberd is designed to be a rock-solid and feature rich XMPP server.

ejabberd is suitable for small deployments, whether they need to be scalable or not, as well as extremely big deployments.

@hightemp
hightemp / Java Periodic table of elements
Created May 24, 2016 12:08 — forked from felixdivo/Java Periodic table of elements.java
This Java enum (=singleton) provides information about the elements of the periodic table (PTE). (Symbol, full name, atomic number, average atomic mass and electron negativity by Pauling) It can be searched by symbol and atomic number.
package divo.felix.chem.pte;
import java.util.HashMap;
import java.util.Map;
/**
* Holds information of the periodic table of elements.
*
* @author Felix Divo
*/
@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 / 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 / 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")