Skip to content

Instantly share code, notes, and snippets.

@jpertino
jpertino / simpleJettyServer.groovy
Created January 20, 2011 04:29
a simple embedded jetty server
@Grab('org.mortbay.jetty:jetty-embedded:6.1.26')
import static org.mortbay.jetty.Handler.DEFAULT
import org.mortbay.jetty.Server
import org.mortbay.jetty.servlet.Context
import org.mortbay.jetty.servlet.DefaultServlet
import org.mortbay.servlet.MultiPartFilter
import groovy.servlet.GroovyServlet
import groovy.servlet.TemplateServlet
@olistik
olistik / gist:2627011
Last active August 12, 2021 06:39
Ubuntu 12.10 setup (rbenv/RVM, Janus, PostgreSQL)

Ubuntu 12.10 setup (rbenv/RVM, Janus, PostgreSQL)

Basic pre-requisites

  • Some utilities:
sudo apt-get install vim tmux git curl
  • Copy/paste from the command line:
@Shinpeim
Shinpeim / tex.c
Created July 31, 2012 05:49
理系男子に朗報
#include <stdio.h>
int main(int argc, char *argv[]){
char chars[] = "TeX";
chars[0]--;
printf("%s",chars);
return 0;
}
@fukamachi
fukamachi / gist:4109258
Last active May 27, 2016 21:05
Pretty lambda/nil for Emacs
;; This function is quoted from this page. Thanks to Tomohiro Matsuyama.
;; http://dev.ariel-networks.com/Members/matsuyama/pretty-lambda-in-emacs/
(defun set-pretty-patterns (patterns)
(loop for (glyph . pairs) in patterns do
(loop for (regexp . major-modes) in pairs do
(loop for major-mode in major-modes do
(let ((major-mode (intern (concat (symbol-name major-mode) "-mode")))
(n (if (string-match "\\\\([^?]" regexp) 1 0)))
(font-lock-add-keywords major-mode
`((,regexp (0 (prog1 ()
#!/usr/bin/env ruby
LOOK = `which look 2>/dev/null`.strip
abort "#{$0} requires |look| executable command" unless File.executable?(LOOK)
def calculate_clarity(word)
candidates = `#{LOOK} -f #{word}`.strip.lines
$?.success? ? candidates.count : 0
end
@ryanmaxwell
ryanmaxwell / ryan-objc.cfg
Last active June 26, 2019 16:41
Objective-C Uncrustify Config
#
# Uncrustify Configuration File
# File Created With UncrustifyX 0.2 (140)
#
# Alignment
# ---------
## Alignment
@Shinpeim
Shinpeim / 005.md
Last active July 14, 2021 20:18
プロセスとかの話 : preforkサーバーを書く

重要

サイズがあまりに大きくなってしまったので、gist ではなくて github 上で管理するようにしました。

https://github.com/Shinpeim/process-book

URL 変わっちゃうの申し訳ないんだけど、一覧性が高くなるのと pull req が受け取れるメリットのほうを取ります。せっかく読みにきてくれたのにひと手間かかっちゃってすみません。

@Shinpeim
Shinpeim / with-sound
Last active December 14, 2015 03:18
https://github.com/moznion/App--Prove--WithSound/blob/master/prove-with-sound これ、どんなコマンドでもいいようにしてみた
#!/usr/bin/env perl
use strict;
use warnings;
use Audio::Play::MPG123;
use Config::Simple;
use File::Spec::Functions qw/catfile/;
sub load_config {
my $config = Config::Simple->new( catfile( $ENV{HOME}, '.with-soundrc' ) );
return $config->param('SUCCESS'), $config->param('FAILURE');
@Shinpeim
Shinpeim / 006.md
Last active December 14, 2015 08:19
ゾンビプロセスと孤児プロセス

重要

サイズがあまりに大きくなってしまったので、gist ではなくて github 上で管理するようにしました。

https://github.com/Shinpeim/process-book

URL 変わっちゃうの申し訳ないんだけど、一覧性が高くなるのと pull req が受け取れるメリットのほうを取ります。せっかく読みにきてくれたのにひと手間かかっちゃってすみません。