Skip to content

Instantly share code, notes, and snippets.

View tudisco's full-sized avatar

Jason Tudisco tudisco

  • San Miguel de Allende
View GitHub Profile
@tudisco
tudisco / lazyload_google_analytics.html
Created October 20, 2018 22:49 — forked from Nilpo/lazyload_google_analytics.html
Lazy load Google Analytics
<script type="text/javascript">
(function($) {
$("body").load(function() {
setTimeout(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
}, 1);
});
})(jQuery);
@tudisco
tudisco / graphite-client.py
Last active July 11, 2016 06:24 — forked from codification/graphite-client.py
Graphite client in python
import sys
import time
import socket
def now():
return int(time.time())
def collect_metric(name, value, timestamp=None):
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.connect( ("localhost", 2003) )
@tudisco
tudisco / gist:1348e694e5e18d94f2a9
Created October 21, 2015 21:08 — forked from ward/gist:8742475
Dump rtsp into mp4 file
ffmpeg -i rtsp://yourlinkhere -acodec copy -vcodec copy FILENAME.mp4
@tudisco
tudisco / requirements.txt
Created October 21, 2015 21:07 — forked from mosquito/requirements.txt
RTSP to HTTP python proxy
tornado>4
construct
vlc -I dummy -d rtsp://192.168.0.99/video.mjpg --no-sout-audio --sout "#transcode{vcodec=MJPG,vb=1000,fps=15}:standard{access=http{mime=multart/x-mix-replace;boundary=myboundary},mux=mpjpeg,dst=:8090/cam.mjpg}"
@tudisco
tudisco / gist:4b93df380df285e0a96e
Created October 21, 2015 21:06 — forked from aborilov/gist:a90c737e7145ebc26a87
streaming rtsp to html5
gst-launch-1.0 --gst-debug=0 rtspsrc location=rtsp://rtsp.algont:4000/eVn5uSYhxRf84A6Hs5193 ! rtph264depay ! h264parse ! matroskamux ! tcpserversink host=192.168.2.147 port=8801
@tudisco
tudisco / 0_reuse_code.js
Created October 15, 2015 08:57
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<?php
// Author: Ngo Minh Nam
$dir = "/path/to/your/repo/";
$output = array();
chdir($dir);
exec("git log",$output);
$history = array();
foreach($output as $line){
if(strpos($line, 'commit')===0){
@tudisco
tudisco / mysql2sqlite.sh
Created June 20, 2012 00:42 — forked from esperlu/mysql2sqlite.sh
MySQL to Sqlite converter
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite