Open the postgresql.conf config file:
$> mate /usr/local/var/postgres/postgresql.conf
Uncomment the line with 'log_destination' and set it to 'syslog'
log_destination = 'syslog'
Open the syslog config:
#!/bin/sh | |
#This is a start script for nginx. Tested on Unbuntu Edge. | |
#Should work on Ubuntu, Debian and probably a few other Linux distros. | |
#Change DAEMON and CONFIG_FILE if neccessary | |
PATH=/sbin:/bin:/usr/sbin:/usr/bin | |
#Location of nginx binary. Change path as neccessary |
((call/cc call/cc) (call/cc call/cc)) ; create k1, pass to call/cc | |
((call/cc k1) (call/cc call/cc)) ; create k2, pass to k1 | |
((k1 k2) (call/cc call/cc)) ; call (k1 k2), abandon stack | |
(k2 (call/cc call/cc)) ; fill k1 hole with k2. create k3, pass to call/cc | |
(k2 (call/cc k3)) ; create k4, pass to k3 | |
(k2 (k3 k4)) ; call (k3 k4), abandon stack | |
(k3 k4) ; fill k3 hole with k4 | |
(k2 k4) ; call (k2 k4), abandon stack |
;; this file is a walkthrough of Moustache features, a web framework for Clojure | |
;; http://github.com/cgrand/moustache/tree/master | |
;; Moustache allows to declare routes, apply middlewares and dispatch on http methods. | |
;; Moustache is compatible with all frameworks built on Ring, including Compojure | |
(ns demo | |
(:use net.cgrand.moustache) | |
(:use [ring.adapter.jetty :only [run-jetty]])) ;; hmmm Ring without servlets | |
The regex patterns in this gist are intended to match any URLs, | |
including "mailto:foo@example.com", "x-whatever://foo", etc. For a | |
pattern that attempts only to match web URLs (http, https), see: | |
https://gist.github.com/gruber/8891611 | |
# Single-line version of pattern: | |
(?i)\b((?:[a-z][\w-]+:(?:/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’])) |
In this gist we will first show that we can beat the arc challenge | |
(http://www.paulgraham.com/arcchallenge.html), and then build the library that | |
shows how we did it. This gist is Literate Haskell and is of course executable. The packages needed are happstack-server and applicative-extras, installable using cabal. | |
Let's start with some imports (for now, you can ignore these) | |
> {-# LANGUAGE GADTs, TypeSynonymInstances #-} | |
> module ArcChallenge where | |
> | |
> import Control.Applicative |
/*********************************************************************** | |
* connect.c -- Make socket connection using SOCKS4/5 and HTTP tunnel. | |
* | |
* Copyright (c) 2000-2006 Shun-ichi Goto | |
* Copyright (c) 2002, J. Grant (English Corrections) | |
* Copyright (c) 2010, Reini Urban (added realm to http_auth basic) | |
* | |
* This program is free software; you can redistribute it and/or | |
* modify it under the terms of the GNU General Public License | |
* as published by the Free Software Foundation; either version 2 |
Open the postgresql.conf config file:
$> mate /usr/local/var/postgres/postgresql.conf
Uncomment the line with 'log_destination' and set it to 'syslog'
log_destination = 'syslog'
Open the syslog config:
SUMMARY | |
I like to use kcachegrind for doing profiling on my ruby code. Most of my development | |
is done on OSX, and while you can install kcachegrind via macports, it takes forever | |
because it has to build KDE, as well. Much to my surprise, the fine folks who | |
wrote kcachegrind also made a QT version, qcachegrind. I was able to build this on | |
OSX without too much effort, only having to install QT and GraphViz. Yippie! | |
I'm running OSX 10.6.7, with Xcode 4. My default gcc/g++ version is 4.2. I'm sure | |
it will build just fine on earlier versions of Xcode, but I haven't tested it. |
(import '[clojure.asm Opcodes Type ClassWriter] | |
'[clojure.asm.commons Method GeneratorAdapter]) | |
(defn make-class [name] | |
(let [cw (ClassWriter. ClassWriter/COMPUTE_FRAMES) | |
init (Method/getMethod "void <init>()") | |
meth (Method/getMethod "int fact(int)")] | |
(.visit cw Opcodes/V1_6 Opcodes/ACC_PUBLIC (.replace name \. \/) nil "java/lang/Object" nil) | |
(doto (GeneratorAdapter. Opcodes/ACC_PUBLIC init nil nil cw) | |
(.visitCode) |
#!/usr/local/Gambit-C/bin/gsi | |
; Copyright (C) 2004 by Marc Feeley, All Rights Reserved. | |
; This is the "90 minute Scheme to C compiler" presented at the | |
; Montreal Scheme/Lisp User Group on October 20, 2004. | |
; Usage with Gambit-C 4.0: | |
; | |
; % ./90-min-scc.scm test.scm |