Skip to content

Instantly share code, notes, and snippets.

View dz0ny's full-sized avatar
💭
❤️✖️❓🤖

Janez Troha dz0ny

💭
❤️✖️❓🤖
View GitHub Profile
<?php
$defaults = array(
'title' => false,
'href' => false,
'parent' => false, // false for a root menu, pass the ID value for a submenu of that menu.
'id' => false, // defaults to a sanitized title value.
'meta' => false // array of any of the following options: array( 'html' => '', 'class' => '', 'onclick' => '', target => '', title => '' );
);
window.Array.prototype.includes=function(a){if(!(a instanceof Array))for(var b=0,c=a.length;b<c;++b)if(this.indexOf(a[b])===-1)return!1;return!0};
window.Array.prototype.includes=function(a){if(!(a instanceof Array))for(var b=0,c=a.length;b<c;++b)if(this.indexOf(a[b])===-1)return!1;return!0};
@dz0ny
dz0ny / radio.sh
Created April 25, 2011 17:57
for Linux and Mac lovers, flash FMS server to shout-cast stream
# using rtmpdump && VLC
nohup rtmpgw -g 8080 -r "rtmp://fms.rtvslo.si/live/ra1-low" -v -V & nohup vlc-wrapper "http://127.0.0.1:8080" -I dummy --sout "#transcode{vcodec=none,acodec=mp3,ab=128,channels=2,samplerate=48000}:duplicate{dst=http{mux=raw,dst=:8001/},dst=std{access=shout,mux=mp3,dst=:8000//ra1}}"
#shoutcast stream(ipdaish) http://server:8000/ra1
#http(everything else) http://server:8001
@dz0ny
dz0ny / facebook.js
Created June 5, 2011 11:23
auth strategyfacebook
/*!
* Copyright(c) 2010 Ciaran Jessup <[email protected]>
* MIT Licensed
*/
var OAuth = require("oauth").OAuth2,
url = require("url"),
connect = require("connect"),
http = require('http');
Facebook = module.exports = function(options, server) {
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-16183651-5']);
_gaq.push(['_trackPageview']);
(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);
<!-- nepravilni parametri-->
<table class="wp-caption" border="0" style="" ...>
<!-- pravilno je samo -->
<table>
@dz0ny
dz0ny / gist:1241769
Created September 26, 2011 07:16
Kako nastaviti RA1, Val202 za internetne(spletne) radie (mp3,wma,ra)

V osnovi moramo pri vseh vnesti eno od povezav, katero podpira predvajalnik.

..Vse povezave lahko odprete s pomočjo VLC predvajalnika, preko opcije odpri omrežno povezavo...

Prvi program (RA1)

  • WMA prenos: mms://helix10.rtvslo.si/wmtencoder/ra1.wma
  • Flash prenos: rtmp://fms.rtvslo.si/live/ra1
  • RealAudio: rtsp://helix10.rtvslo.si/broadcast/ra1.rm
#!/bin/bash
curl --user admin:hackme "http://localhost:8000/admin/metadata.xsl?song=AVTOR-PESEM&mount=/val202&mode=updinfo&charset=UTF-8"
@dz0ny
dz0ny / gist:1291239
Created October 16, 2011 18:31
Ubuntu ATI Aspirin(tm)
sudo /usr/share/ati/fglrx-uninstall.sh
sudo apt-get --yes --force-yes -y purge fglrx*
sudo apt-get --yes --force-yes -y purge xserver-xorg-video-ati xserver-xorg-video-radeon
sudo apt-get --yes --force-yes -y install xserver-xorg-video-ati
sudo dpkg -r --ignore-depends libgl1-mesa-glx libgl1-mesa-glx
sudo apt-get --yes --force-yes -y install libgl1-mesa-glx libgl1-mesa-dri
sudo apt-get --yes --force-yes -y install --reinstall xserver-xorg-core
sudo mv /etc/X11/xorg.conf /etc/X11/xorg.conf.bad