View pre-commit
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 | |
# | |
# Shamelessly stolen from: | |
# http://www.es.ele.tue.nl/sdf3/manuals/development/files/pre-commit | |
# An example hook script to verify what is about to be committed. | |
# Called by "git commit" with no arguments. The hook should | |
# exit with non-zero status after issuing an appropriate message if | |
# it wants to stop the commit. | |
# | |
# To enable this hook, rename this file to "pre-commit". |
View list-disks.c
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
#include <gio/gunixmounts.h> | |
#include <glib.h> | |
/* Compile with: | |
gcc list-disks.c $(pkg-config --libs --cflags gio-unix-2.0) -std=c11 -ggdb3 -W -Wall | |
*/ | |
int main(void) { | |
g_printerr("MOUNTS:\n"); |
View app.css
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
/* Support for colored labels. | |
* These are sometimes handy in order to highlight errors | |
* or mark some entries with "xx new items". | |
*/ | |
#AppIndicatorLabelError, | |
#AppIndicatorLabelSuccess, | |
#AppIndicatorLabelWarning, | |
#AppIndicatorLabelTheme { | |
/* Animate changes so the label color gets faded in */ |
View get-n-fds.c
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
int rm_fd_cache_get_fds_per_process(RmFdCache *self) { | |
g_assert(self); | |
int n = -1; | |
struct rlimit rl; | |
if(getrlimit(RLIMIT_NOFILE, &rl) == -1) { | |
return -1; | |
} |
View moose_zeroconf.py
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 python | |
# encoding: utf-8 | |
from gi.repository import Moose | |
from gi.repository import GLib | |
import sys | |
def zeroconf_state_changed(browser): |
View glyr_opt_dlcallback.rb
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
require './glyros.so' | |
q = Glyros::GlyrQuery.new | |
Glyros::glyr_query_init(q) | |
Glyros::glyr_opt_artist(q,"Equilibrium") | |
Glyros::glyr_opt_type(q,Glyros::GLYR_GET_ARTIST_PHOTOS) | |
Glyros::glyr_opt_number(q,5) | |
my_proc = Proc.new do |cache,query| | |
Glyros::glyr_cache_print cache |
View glyr_dbtest.rb
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
require './glyros.so' | |
include Glyros | |
# Brief example on how to use glyr_db_foreach() and the require macros | |
# Sorry if this looks like Ruby. It's acutally ruby-flavoured C :-) | |
# A filled DB is required, read to use example: | |
# $ glyrc artistphotos -a "Bring me the horizon" -n 10 -c /tmp | |
# Gets the 'requirements' for a certain fetcher by it's type |
View glyr_providertest.rb
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
require './glyros.so' | |
include Glyros | |
# Simple example on how to directly call a certain | |
# provider's get_url() and parser() function. | |
# We need a query (as usual) | |
q = GlyrQuery.new | |
glyr_query_init(q) | |
glyr_opt_artist(q,"Equilibrium") |
View glyr_reqs.rb
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
require './glyros.so' | |
include Glyros | |
# Simple example on how to use glyr_info_get | |
# and the require macros appear here too. | |
def req_to_string reqs, required, optional | |
return "required" if (reqs & required) != 0 | |
return "optional" if (reqs & optional) != 0 | |
return "not needed" |
OlderNewer