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/perl | |
use strict; | |
use warnings; | |
use utf8; | |
use IO::Socket::INET6; | |
use LWP::UserAgent; | |
## Use IO::Socket::INET6 instead of IO::Socket::INET6 in Net::HTTP. | |
BEGIN { |
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 | |
# | |
# PROVIDE: plack_app | |
# REQUIRE: LOGIN | |
# BEFORE: cron | |
# | |
# Add the following lines to /etc/rc.conf to enable the webapp: | |
# plack_app_enable (bool): Set to "NO" by default. |
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
var has = function (obj, property) { | |
var tree = obj, | |
split = property.split('.'), | |
last = split.pop(); | |
while (next = split.shift()) { | |
tree = tree[next]; | |
if (tree === undefined) return false; | |
} |
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
# I want a tool that tells me what my modified files are, whether I'm in a Subversion or Git project. | |
# I want to be able to say vim $(dirty) | |
#!/usr/bin/perl | |
use warnings; | |
use strict; | |
my @lines = qx/svn status 2>&1/; | |
exit if @lines == 0; |
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
ss23@Crisp /etc/init.d $ cat vixie-cron | |
#!/sbin/runscript | |
# Copyright 1999-2011 Gentoo Foundation | |
# Distributed under the terms of the GNU General Public License v2 | |
# $Header: /var/cvsroot/gentoo-x86/sys-process/vixie-cron/files/vixie-cron.rc7,v 1.1 2011/12/31 14:58:21 idl0r Exp $ | |
command=/usr/sbin/cron | |
pidfile=/var/run/cron.pid | |
depend() { |
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
(use '[clojure.core.match :only [match]]) | |
(defn evaluate [env [sym x y]] | |
(match [sym] | |
['Number] x | |
['Add] (+ (evaluate env x) (evaluate env y)) | |
['Multiply] (* (evaluate env x) (evaluate env y)) | |
['Variable] (env x))) | |
(def environment {"a" 3, "b" 4, "c" 5}) |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://code.jquery.com/jquery-1.4.2.min.js"></script> | |
<script src="http://maps.googleapis.com/maps/api/js?sensor=false"></script> | |
<script> | |
jQuery(window).ready(function(){ | |
g_initialize(); | |
jQuery("#findLocationBtn").click(initiate_geolocation); | |
}); |
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
server { | |
listen 80; | |
server_name CHANGEME.app; | |
root /var/www/vhosts/CHANGEME.app/public; | |
index index.html index.htm index.php; | |
charset utf-8; | |
location / { |
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 | |
# PROVIDE: ping_api | |
# REQUIRE: NETWORKING | |
# KEYWORD: shutdown | |
. /etc/rc.subr | |
name="ping_api" | |
rcvar=`set_rcvar` |
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
# qdbus lists all service names of services that are running and you can manipulate at the moment. | |
qdbus | |
# control dbus | |
qdbus org.mpris.MediaPlayer2.clementine /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next | |
qdbus org.mpris.MediaPlayer2.clementine /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous | |
# and use --literal if you need to print the reply in plain text | |
qdbus --literal org.mpris.MediaPlayer2.clementine /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Playlists.ActivatePlaylist /org/mpris/MediaPlayer2/Playlists/20 |
OlderNewer