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
module Cache | |
def Cache.file(filename, cache_lifetime=604800) | |
if File.exists?(filename) | |
if File.mtime(filename) < (Time.now - cache_lifetime) | |
body = yield | |
File.open(filename, 'w') do |file| | |
file << body.to_yaml | |
end | |
return body | |
else |
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
package com.xhochy | |
import com.tinkerpop.blueprints.impls.neo4j.Neo4jGraph | |
import com.tinkerpop.blueprints.util.io.graphml.GraphMLReader | |
import java.io.FileInputStream | |
/** | |
*/ | |
object App { |
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
package com.xhochy | |
import com.tinkerpop.blueprints.impls.neo4j.Neo4jGraph | |
import com.tinkerpop.blueprints.util.io.graphml.GraphMLReader | |
import java.io.FileInputStream | |
/** | |
*/ | |
object App { |
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
blocked_ips = [ipv4Network[0], ipv4Router] | |
ranges = [[ipv4Network[1], ipv4Network[-1]]] | |
for ip in blocked_ips: | |
index = 0 | |
# Find range which includes the ip, i.e. 'start <= ip <= end' | |
while (index < len(ranges)) and (not ((ranges[index][0] <= ip) and (ip <= ranges[index][1]))): | |
index += 1 | |
if index == len(ranges): | |
# IP address is already excluded | |
pass |
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 | |
LD_PRELOAD="\${LD_PRELOAD} /usr/share/spotify/libcef.so" | |
export LD_PRELOAD | |
exec ${SPOTIFY_HOME}/spotify |
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
# Copyright 1999-2012 Gentoo Foundation | |
# Distributed under the terms of the GNU General Public License v2 | |
# $Header: /var/cvsroot/gentoo-x86/media-libs/libechonest/libechonest-2.0.1.ebuild,v 1.2 2012/12/27 23:14:16 hasufell Exp $ | |
EAPI=4 | |
inherit cmake-utils | |
DESCRIPTION="A library for communicating with The Echo Nest" | |
HOMEPAGE="http://projects.kde.org/projects/playground/libs/libechonest" | |
SRC_URI="http://files.lfranchi.com/${P}.tar.bz2 |
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
package com.xhochy | |
import com.tinkerpop.blueprints.impls.tg.TinkerGraph | |
import com.tinkerpop.furnace.generators.{ CommunityGenerator, EdgeAnnotator, NormalDistribution, PowerLawDistribution, VertexAnnotator } | |
object Generator { | |
def main(args: Array[String]) = { | |
val graph = new TinkerGraph | |
Range(0, 100).foreach(graph.addVertex(_)) | |
val generator = new CommunityGenerator("edge", EdgeAnnotator.NONE, VertexAnnotator.COPY_CONTEXT) |
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
(gdb) bt | |
#0 0x0000000001cbaa20 in ?? () | |
#1 0x00000000011301f7 in ?? () | |
#2 0x000000000113054f in ?? () | |
#3 0x0000000000cfa2b2 in ?? () | |
#4 0x0000000000cfa424 in ?? () | |
#5 0x0000000000e14bc9 in ?? () | |
#6 0x0000000000d2385f in ?? () | |
#7 0x0000000000d1a6bf in ?? () | |
#8 0x0000000000d1d61b in ?? () |
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
-- Mediakeys directly control tomahawk | |
globalkeys = awful.util.table.join(globalkeys, | |
awful.key({ }, "XF86AudioPrev", function () awful.util.spawn("dbus-send --print-reply --dest=org.mpris.MediaPlayer2.tomahawk /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous") end), | |
awful.key({ }, "XF86AudioPlay", function () awful.util.spawn("dbus-send --print-reply --dest=org.mpris.MediaPlayer2.tomahawk /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause") end), | |
awful.key({ }, "XF86AudioStop", function () awful.util.spawn("dbus-send --print-reply --dest=org.mpris.MediaPlayer2.tomahawk /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop") end), | |
awful.key({ }, "XF86AudioNext", function () awful.util.spawn("dbus-send --print-reply --dest=org.mpris.MediaPlayer2.tomahawk /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next") end) | |
) |
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
# Description: | |
# Tell Hubot to send a user a message when present in the room | |
# | |
# Dependencies: | |
# None | |
# | |
# Configuration: | |
# None | |
# | |
# Commands: |
OlderNewer