This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="jquery-1.6.1.min.js"></script> | |
<script src="socket.io/socket.io.js"></script> | |
<script> | |
var socket = new io.Socket(null,{port:8080}); | |
socket.connect(); | |
socket.on('message',function(obj){ | |
switch(obj.tipo){ | |
case 'imagen': | |
img = document.getElementById('stream'); | |
img.src=""; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getColor() | |
{ | |
$tod = localtime(); | |
$now = $tod[1] + ($tod[2] * 60.0); | |
$now = $now * (1.0 / (24.0 * 60.0)); | |
$rgb_array = HSV_TO_RGB($now, 0.5, 0.5); | |
$rgb = dechex($rgb_array['R']) . dechex($rgb_array['G']) . dechex($rgb_array['B']); | |
return ($rgb); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# This script is used to set up vsftpd for multiple virtual users with predefined passwords | |
# fetched from a text file. The vsftpd configuration file that is outputted enforces | |
# FTP Explicit TLS for all client connections. | |
# | |
# The text file with predefined users and passwords must have the following format: | |
# <username>:<password> | |
# | |
userfile=users.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# webm | |
ffmpeg -i IN -f webm -vcodec libvpx -acodec libvorbis -ab 128000 -crf 22 -s 640x360 OUT.webm | |
# mp4 | |
ffmpeg -i IN -acodec aac -strict experimental -ac 2 -ab 128k -vcodec libx264 -vpre slow -f mp4 -crf 22 -s 640x360 OUT.mp4 | |
# ogg (if you want to support older Firefox) | |
ffmpeg2theora IN -o OUT.ogv -x 640 -y 360 --videoquality 5 --audioquality 0 --frontend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Examples: | |
# ./image64.sh myImage.png | |
# outputs: data:image/png;base64,xxxxx | |
# ./image64.sh myImage.png -img | |
# outputs: <img src="data:image/png;base64,xxxxx"> | |
filename=$(basename $1) | |
xtype=${filename##*.} | |
append="" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//return an array of objects according to key, value, or key and value matching | |
function getObjects(obj, key, val) { | |
var objects = []; | |
for (var i in obj) { | |
if (!obj.hasOwnProperty(i)) continue; | |
if (typeof obj[i] == 'object') { | |
objects = objects.concat(getObjects(obj[i], key, val)); | |
} else | |
//if key matches and value matches or if key matches and value is not passed (eliminating the case where key matches but passed value does not) | |
if (i == key && obj[i] == val || i == key && val == '') { // |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
=begin | |
http://marked2app.com | |
Marked 2 preprocessor - "Lazy" footnotes. | |
Allows use of `[^]` or `†` footnote references | |
where the next [^]: or †: note defines the text of the footnote. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for f in *.m4a; do sox "$f" -C 56 "${f%.m4a}.mp3"; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Encodes multi-byte Unicode string into utf-8 multiple single-byte characters | |
* (BMP / basic multilingual plane only). | |
* | |
* Chars in range U+0080 - U+07FF are encoded in 2 chars, U+0800 - U+FFFF in 3 chars. | |
* | |
* Can be achieved in JavaScript by unescape(encodeURIComponent(str)), | |
* but this approach may be useful in other languages. | |
* | |
* @param {string} unicodeString - Unicode string to be encoded as UTF-8. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name StartPage Bangs | |
// @namespace http://tarkus.co/ | |
// @version 0.1 | |
// @description Adds !s to StartPage, like DDG | |
// @match https://startpage.com/* | |
// @run-at document-start | |
// ==/UserScript== | |
// Bangs |
OlderNewer