Skip to content

Instantly share code, notes, and snippets.

@jesg
jesg / gist:9917946
Created April 1, 2014 16:40
i3-conky-configuration
out_to_x no
own_window no
out_to_console yes
background no
max_text_width 0
# Update interval in seconds
update_interval 2.0
# This is the number of times Conky will update before quitting.
module Lisp
def self.lexer(str)
tokens = Array.new
str
.gsub(/\(/, ' ( ')
.gsub(/\)/, ' ) ')
.split(/\s/)
.each do |token|
#!/bin/bash
delay=1
if (( $# == 1 )); then
delay=$1
fi
while true; do
eval $(xdotool getmouselocation --shell 2> /dev/null)
@jesg
jesg / lpopall
Last active August 29, 2015 14:06
pop all elements from a redis list
local result = {}
local length = tonumber(redis.call('LLEN', KEYS[1]))
for i = 1 , length do
local val = redis.call('LPOP',KEYS[1])
if val then
table.insert(result,val)
end
end
return result
@jesg
jesg / gist:f4e86e897010edc3f46a
Last active August 29, 2015 14:10
systemd config for standalone selenium on docker
[Unit]
Description=Selenium Standalone Server
Requires=docker.service
After=docker.service
[Service]
TimeoutStartSec=0
ExecStartPre=-/usr/bin/docker kill selenium-standalone
ExecStartPre=-/usr/bin/docker rm selenium-standalone
ExecStartPre=-/usr/bin/docker pull jesg/selenium:standalone
@jesg
jesg / app.rb
Last active December 24, 2022 09:27
run sinatra on puma application server behind nginx as a reverse proxy
# /home/<user>/hello-nginx-sinatra/app.rb
require 'rubygems'
require 'sinatra/base'
class App < Sinatra::Application
get '/app' do
"hello world!"
end
transform(State1,State2,[State1|Plan]) :-
transform(State1,State2,[State1],Plan), Plan \== [].
transform(State,State,Visited,[]).
transform(State1,State2,Visited,[State|Actions]) :-
edge(State1,State),
not(member(State,Visited)),
transform(State,State2,[State|Visited],Actions).
edge(a,b).
# Common configuration.
AllCops:
# Additional cops that do not reference a style guide rule may be enabled by
# default. Change behavior by overriding StyleGuideCopsOnly, or by giving
# the --only-guide-cops option.
StyleGuideCopsOnly: true
# Use ` or %x around command literals.
Style/CommandLiteral:
EnforcedStyle: mixed
@jesg
jesg / .vimrc
Last active March 17, 2016 02:44
vim config
if has('vim_starting')
set nocompatible " Be iMproved
" Required:
set runtimepath+=~/.vim/bundle/neobundle.vim/
endif
set runtimepath^=~/.vim/bundle/ag
let neobundle_readme=expand('~/.vim/bundle/neobundle.vim/README.md')
@jesg
jesg / pub_key.txt
Created June 8, 2015 23:56
my public key - used to sign dither
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2
mQINBFVyKwUBEADkE+eMdCaNcEVABmDZBprxLTt1ZnROqLjQiJuyNEtNg34x66wp
F9alOqDmlcoNlP35RVppzOUjVjQ5nY/V91Z5s9TuDuE0YwuuztvYW8DxMK3skPbj
ob63xrsNYz8wrGvUj2SFrqohYgWeTc4OCetDNyE3Jpgq/XpqLgHa5kWjaP2jkbbm
sXnkIyYlyKTanFo/JPo8RKdCtnyq1IZjkuELjwlEhXzBB0oNDQUqfaoWUI7liHcF
YSSz1bRhHfJfk9g1mEOwH9UhFvg6WeFtNPdCn8uT+KHe9YKbHqwLF3MD+7JNsuy8
OM4bKUOPIoDqFRuA4QQ99ZuIK3hnP1Z4TSPvHjoSZDGV7rTr9t2hhuN8vP0OHtCM
vZPy6bMDWk6y0UWpnlCSsLAv8g4R/fpRCI3ab98LJjgV165bjvfKdEtXoaPboul9