Skip to content

Instantly share code, notes, and snippets.

@acdimalev
acdimalev / twitch.sh
Created April 27, 2013 04:43
Streaming to Twitch using avconv (X11 and PulseAudio)
#!/bin/sh
key=live_... # grab this from your Twitch account
url=rtmp://live.twitch.tv/app/$key
# I'm pulling from my second monitor (-i :0.1)
# at fifteen frames a second (-r 15).
#
# It has an sxga resolution that I'm scaling to 524x420.
#
int cube_edge_vertex_index(int index) {
// a represents orientation
int a = index >> 3;
int b = index & 7;
// rotate b
int c = b >> (3 - a);
int d = (b << a) & 7;
return c | d;
}
@acdimalev
acdimalev / pidgin-less-smart-conv-tab.patch
Created January 19, 2014 04:30
Replace Pidgin's "next unread tab" feature with the original behavior of ctrl+tab / ctrl+shift+tab.
diff -r 1d3a0e42cb09 pidgin/gtkconv.c
--- a/pidgin/gtkconv.c Mon Nov 25 16:51:46 2013 +0100
+++ b/pidgin/gtkconv.c Wed Nov 27 00:37:20 2013 -0800
@@ -2019,9 +2019,15 @@
case GDK_KEY_KP_Tab:
case GDK_KEY_ISO_Left_Tab:
if (event->state & GDK_SHIFT_MASK) {
- move_to_next_unread_tab(gtkconv, FALSE);
+ if (!pidgin_conv_window_get_gtkconv_at_index(win, curconv - 1))
+ gtk_notebook_set_current_page(GTK_NOTEBOOK(win->notebook), -1);
@acdimalev
acdimalev / pidgin-chatroom-default-alias.patch
Created January 19, 2014 04:36
Switch Pidgin's default username for Jabber chats from the Jabber username to the account's local alias.
diff -r 1d3a0e42cb09 libpurple/protocols/jabber/chat.c
--- a/libpurple/protocols/jabber/chat.c Mon Nov 25 16:51:46 2013 +0100
+++ b/libpurple/protocols/jabber/chat.c Wed Nov 27 01:39:56 2013 -0800
@@ -74,7 +74,8 @@
defaults = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, g_free);
- g_hash_table_insert(defaults, "handle", g_strdup(js->user->node));
+ const char *alias = purple_account_get_alias(purple_connection_get_account(gc));
+ g_hash_table_insert(defaults, "handle", g_strdup(alias ? alias : js->user->node));
#!/bin/sh
# either list sinks
if test $# -eq 0; then
pacmd list-sinks | grep 'index:\|name:'
exit
fi
# or set sink
# need Cisco WebEx on 64-bit Debian?
apt-get install libxmu6:i386 libxtst6:i386 libxt6:i386 libasound2:i386 libxv1:i386 libuuid1:i386 openjdk-7-jre-headless:i386
@acdimalev
acdimalev / gist:f8b003b9929aa7217857
Created June 4, 2015 21:22
Debian 8 Skype dependencies
apt-get install libxss1:i386 libqtdbus4:i386 libqtwebkit4:i386
let str_vec: Vec<&str> = vec!["foo", "bar", "baz"];
let string_vec: Vec<String> = str_vec.iter().map(|s| s.to_string()).collect();
extern crate combine;
use std::collections::HashMap;
use combine::primitives::{State, Stream, ParseResult};
use combine::{many, many1, token, satisfy, parser, sep_end_by1};
use combine::{Parser, ParserExt};
fn entry<I>(input: State<I>) -> ParseResult<(String, String), I>
where I: Stream<Item=char> {
@acdimalev
acdimalev / shell.hs
Last active December 29, 2015 14:42
import Data.List
import System.Directory as D
import System.Posix.Signals as S
import System.Posix.Process as P
import System.Posix.Terminal as T
hiddenFile = (== '.') . head
signals = [S.sigTTOU]