Skip to content

Instantly share code, notes, and snippets.

@ivoscc
ivoscc / gist:5365488
Created April 11, 2013 17:41
Check if 2 strings are cycles
rotate :: [Char] -> [Char] -> Int -> Bool
rotate _ _ 0 = False
rotate s1 s2 len = if s1' == s2 then True else rotate s1' s2 (len-1)
where s1' = tail s1 ++ [head s1]
cyclep :: [Char] -> [Char] -> Bool
cyclep str1 str2 = rotate str1 str2 (length str1)
@ivoscc
ivoscc / gist:5030284
Created February 25, 2013 14:49
uwsgi.service para gestionar con systemd. Copiar a /usr/lib/systemd/system/uwsgi.service Habilitar con systemctl enable uwsgi.service
[Unit]
Description=uWSGI in Emperor mode
After=syslog.target
[Service]
ExecStart = /usr/bin/uwsgi --ini /etc/uwsgi/emperor.ini
KillSignal=SIGINT
ExecReload=/bin/kill -HUP $MAINPID
Restart = always
Type = notify