Skip to content

Instantly share code, notes, and snippets.

@kyv
kyv / images-tags
Created March 14, 2013 15:42
cakecd tags plugin pagination
#Model/Image.php
...
public $actsAs = array('Tags.Taggable',
'Containable',
);
...
#Controller/ImagesController.php
...
class ImagesController extends AppController {
@kyv
kyv / photos_tag.rb
Last active January 12, 2021 21:10 — forked from sukima/photos_tag.rb
Gallery Tag for Jekyll/Octopress Using extended version of bootstrap carousel
# Title: Gallery Tag for Jekyll
# Authors: Kevin Brown
# Description: gallery using extended bootstrap carousel. Uses a CDN if needed.
#
# Adaption of "Photos tag for Jekyll" by Devin Weaver
# Using bootstrap carosel-extended instead of fancybox: "http://bootsnipp.com/snipps/carousel-extended"
# We have also left out the photo tag and are using solly the gallery function
#
# ** This only covers the markup. Not the integration of carousel-extended **
#
@kyv
kyv / mpdsched
Last active December 18, 2015 00:19
Simple script in ruby which schedules genres of musica by hour. Personally I call it with mpdcron.
#!/usr/bin/env ruby
require 'ruby-mpd'
mpd = MPD.new
mpd.connect
sched = ['Jazz', 'Jazz', 'Classical', 'Classical', 'Country', 'Blues', 'Son Jarocho', 'Jazz', 'Classical', 'Classical', 'Country', 'Blues', 'Jazz', 'Soul', 'R&B', 'R&B', 'Chilena', 'African', 'Afrobeat', 'Cumbia', 'Salsa', 'Tropical', 'Salsa' ,'Classical'] # 0-24
# make list of filenames w/out extension
@kyv
kyv / wavecmp
Created June 19, 2013 14:37
Compare wave files in two folders for length. Shows which files in second folder are closest to the length of files in first folder
#!/usr/bin/env python2
import os, sys
import contextlib
import wave
def main():
folders = []
dir1, dir2 = parseArgs(sys.argv)
print dir1, dir2
@kyv
kyv / vstream
Last active August 29, 2015 14:06
envolutura para dvstream y icecast
#!/bin/bash
# Script facilitador para transmitir video con dvswitch a icecast
# Ejemplo de uso
# vstream -h 127.0.0.1 -p 2000 -d /dev/video1 -i espora.org:8000/vstream.ogg
while [[ $# > 1 ]]
do
key="$1"
shift
@kyv
kyv / dvstream.cmd
Last active August 29, 2015 14:06
command for dvswitch
dvswitch -p2000 -hlocalhost 2>&1 /dev/null &
sleep 1
avconv -v 0 -f video4linux2 -i /dev/video1 -target ntsc-dv - | \
dvsource-file /dev/stdin -p 2000 -h localhost 2>&1 /dev/null &
sleep 5
dvsink-command -h localhost -p 2000 tee /dev/null | \
@kyv
kyv / webm2icecast
Last active August 29, 2015 14:06
gst webm a icecast
gst-launch-0.10 v4l2src device=/dev/video0 ! typefind ! ffmpegcolorspace ! videorate force-fps=12/1 ! vp8enc ! \
queue ! mux. alsasrc ! audioconvert ! audioresample ! audiodynamic ! vorbisenc ! \
queue ! mux. webmmux name=mux streamable=true ! shout2send ip=127.0.0.1 port=8000 mount=montaje.webm password=XXXXX
@kyv
kyv / dvswitchBuildError
Created September 27, 2014 18:47
dvswitch 0.8.3.6 build failure on archlinux
In file included from /home/kevin/proyectos/dvswitch/src/dvswitch-0.8.3.6/src/dv_display_widget.hpp:13:0,
from /home/kevin/proyectos/dvswitch/src/dvswitch-0.8.3.6/src/mixer_window.hpp:21,
from /home/kevin/proyectos/dvswitch/src/dvswitch-0.8.3.6/src/dvswitch.cpp:20:
/home/kevin/proyectos/dvswitch/src/dvswitch-0.8.3.6/src/auto_codec.hpp:22:36: error: ‘CodecID’ no se declaró en este ámbito
auto_codec auto_codec_open_decoder(CodecID);
^
/home/kevin/proyectos/dvswitch/src/dvswitch-0.8.3.6/src/auto_codec.hpp:23:50: error: ‘CodecID’ no se ha declarado
void auto_codec_open_decoder(const auto_codec &, CodecID);
^
/home/kevin/proyectos/dvswitch/src/dvswitch-0.8.3.6/src/auto_codec.hpp:23:57: error: ‘void auto_codec_open_decoder(const auto_codec&, int)’ redeclarado como un tipo diferente de símbolo
@kyv
kyv / dvswitchBuildError9
Created September 27, 2014 18:58
dvswitch 0.9.1-1 build failure on archlinux
/home/kevin/proyectos/dvswitch/src/dvswitch/src/tally_rtsp_server.cpp: En el constructor ‘tally_rtsp_server::RTSPClientSession::RTSPClientSession(tally_rtsp_server&, unsigned int, int, sockaddr_in)’:
/home/kevin/proyectos/dvswitch/src/dvswitch/src/tally_rtsp_server.cpp:60:103: error: no se encontró una función coincidente para la llamada a ‘RTSPServer::RTSPClientSession::RTSPClientSession(tally_rtsp_server&, unsigned int&, int&, sockaddr_in&)’
: RTSPServer::RTSPClientSession(ourServer, sessionId, clientSocket, clientAddr), server_(ourServer)
^
/home/kevin/proyectos/dvswitch/src/dvswitch/src/tally_rtsp_server.cpp:60:103: nota: los candidatos son:
In file included from /home/kevin/proyectos/dvswitch/src/dvswitch/src/tally_rtsp_server.hpp:9:0,
from /home/kevin/proyectos/dvswitch/src/dvswitch/src/tally_rtsp_server.cpp:5:
/usr/include/liveMedia/RTSPServer.hh:271:5: nota: RTSPServer::RTSPClie
@kyv
kyv / mixit.py
Last active August 29, 2015 14:06 — forked from MathieuDuponchelle/mixit.py
from gi.repository import GstPbutils
from gi.repository import Gtk
from gi.repository import Gst
from gi.repository import GES
from gi.repository import GObject
import sys
import signal
def handle_sigint(sig, frame):