Skip to content

Instantly share code, notes, and snippets.

View saml's full-sized avatar

Sam Lee saml

  • New York, NY
View GitHub Profile
-- ghc --make -O2 -threaded setInterval.hs
import Control.Concurrent
import Control.Exception
setInterval action microsecs = do
mvar <- newEmptyMVar
setInterval' mvar action microsecs
takeMVar mvar
description "CQ Author"
author "saml"
start on runlevel [2345]
stop on runlevel [016]
script
sudo -u sam "/home/sam/opt/java/bin/java" -server -Dsling.run.modes=author,localdev -Xmx4096m -XX:PermSize=256m -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSIncrementalMode -XX:+CMSIncrementalPacing -XX:-UseGCOverheadLimit -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=30303,suspend=n -Dcom.day.crx.persistence.tar.IndexMergeDelay=0 -jar "/media/data/cq/cq-quickstart-5.4.0.jar" -p 4502 -v -nobrowser
end script

There are two types of people who will come this far, the first type is obnoxious trolls who's only purpose in life aside from being failures is to ruin things for other people. The other type of people who are slightly off but still filled with heart, willing to go farther than the average fuck in search of the unknown. Curiosity fuels one, sadness and anger fuels the other.

There are truths in this life:

Past and future are illusion. All that is, all that will ever be is the present moment. Your success in life is entirely dependent on understanding the previous statement. In all things you do, large or small, dedicate these 3 things in their entirety: 1. enthusiasm 2. love 3. awareness.

The greatest obstacle in life is your own ego. Your ego wants so many unrealistic things, and it has so many tricks to keep you under its control. In this way we are never satisfied, we are never happy. It takes time, but your dreams entirely depend on you conquering this beast we all have inside of us.

It exists becaus

import os
import random
RANDOM_INTS_PATH='random-ints.txt'
LIMIT=1000000000000000
if not os.path.exists(RANDOM_INTS_PATH):
os.mkfifo(RANDOM_INTS_PATH)
with open(RANDOM_INTS_PATH, 'w') as f:
server {
server_name www.reddit.com reddit.com;
return 302 $scheme://en.reddit.com$request_uri;
}
<%--
resource type query
--%><%@page
import="org.apache.jackrabbit.util.ISO9075,
org.apache.jackrabbit.util.Text,
javax.jcr.query.*,
org.apache.sling.api.resource.*,
java.io.*"
%><%@include file="/libs/foundation/global.jsp"%><%!
@saml
saml / velconvert_ncurses.cpp
Created November 4, 2012 00:46
alsa midi velocity convert
//Simple Velocity Converter.
//ncurses as UI.
//
//Feature and Usage: Creates 1 input and 1 output port.
//Connect midi-out of a device to the input port of Velocity Converter.
//Connect output port of Velocity Converter to midi-in of a device.
//Then, note-on events from a device will be amplified (modified)
//and sent to proper device.
//For example,
// +---------------------+
# -*- coding: utf-8 -*-
# seq 5000 | xargs -P100 -I% python2 selfdb.py k% v%
'''{prog} -- self-logging in-memory key-value storage
Usage:
Display Keys
{prog}
Get Value of Key
{prog} some-key
worker_processes 1;
error_log logs/error.log;
events {
worker_connections 1024;
}
http {
server {
listen 9001;
location /anon {
default_type 'application/json';
@saml
saml / gist:4441053
Created January 3, 2013 05:27
alsa asoundrc human readable name jackd
$ cat /proc/asound/cards 
 0 [Generic        ]: HDA-Intel - HD-Audio Generic
                      HD-Audio Generic at 0xfeb44000 irq 43
 1 [XMidi1X1       ]: USB-Audio - E-MU XMidi1X1
                      E-MU Systems, Inc. E-MU XMidi1X1 at usb-0000:00:12.0-1, full speed
 2 [Generic_1      ]: HDA-Intel - HD-Audio Generic
                      HD-Audio Generic at 0xfeb40000 irq 16

$ pacman -S alsa-plugins