Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View kernelp4nic's full-sized avatar

Sebastián Moreno kernelp4nic

  • Prisma Campaigns
  • Montevideo-Uruguay
View GitHub Profile
@kernelp4nic
kernelp4nic / tag.clj
Created February 10, 2023 15:03 — forked from gsinclair/tag.clj
"
Usage:
In code:
(tag> value) or (t> form arg1 arg2 ...) to tag a value to stdout.
(tagseq> 20 x) or (ts> 20 form arg1 arg2 ...) to tag a sequence, printing 20 items.
Note: the value of a (tag>) or (t>) or (tagseq>) or (ts>) form is always the complete
value, so it can be inserted into code without a problem.
At the REPL:
@kernelp4nic
kernelp4nic / shed.scad
Created May 3, 2021 20:57 — forked from creationix/shed.scad
Shed design. Open in OpenScad to view 3d model.
windows = false; // show windows
stuff = false; // Show bikes, table, mower
l = 32; // Length of building in feet (16, 20, 24, 28, 32, ...)
h = 8*12-4.5+.5;
rl=6*12+1.375+.1; // cut to 73.5" long with 22.5 degree angles
tl = 68.7; // Used to tweak headers on top walls
// 2x6 concrete forms for foundation
// 10" wide grid
@kernelp4nic
kernelp4nic / Redis-Ruby_Inverted-Index-Search-(Antirez)
Last active December 7, 2020 19:08 — forked from antirez/gist:120067
Build an inverted index for a full-text search engine with Redis.
--

Install with Homebrew

brew install redis

Set up launchctl to auto start redis

$ ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents

/usr/local/opt/redis/ is a symlink to /usr/local/Cellar/redis/x.y.z (e.g., 2.8.7)

@kernelp4nic
kernelp4nic / spec.clj
Created August 3, 2017 20:53
clojure.spec on Clojure 1.8
;;[clojure-future-spec "1.9.0-alpha17"]
;;[org.clojure/test.check "0.9.0"]
(require '[clojure.spec.alpha :as s])
(require '[clojure.future :refer :all])
(require '[clojure.spec.test.alpha :as stest])
(defn ranged-rand
"Returns random int in range start <= rand < end"
[start end]
(defmacro assert-all
[& pairs]
`(do (when-not ~(first pairs)
(throw (IllegalArgumentException.
(str (first ~'&form) " requires " ~(second pairs) " in " ~'*ns* ":" (:line (meta ~'&form))))))
~(let [more (nnext pairs)]
(when more
(list* `assert-all more)))))
(defmacro when-let*
@kernelp4nic
kernelp4nic / collectd.conf
Created February 6, 2017 14:33 — forked from ajayverghese/collectd.conf
Sample collectd configuration to fetch jetty and jvm metrics for monitoring (and send to graphite)
#
# Config file for collectd(1).
# Please read collectd.conf(5) for a list of options.
# http://collectd.org/
#
##################
# Global settings
##################
@kernelp4nic
kernelp4nic / .vimrc
Last active July 26, 2016 18:02
minimal vimrc for servers
set runtimepath=~/.vim,/var/lib/vim/addons,/usr/share/vim/vimfiles,/usr/share/vim/vim73,/usr/share/vim/vimfiles/after,/var/lib/vim/addons/after,~/.vim/after
set nocompatible
set showmode
set backspace=2
syntax on
set hlsearch "highlight searched things
set incsearch "incremental search
set laststatus=2 "show status line
set ignorecase "ignore case
@kernelp4nic
kernelp4nic / install.sh
Created July 20, 2016 22:34
Install PostGIS and PGrouting on Debian Wheezy from source
#!/bin/bash
#install postgis
apt-get install libxml++2.6-dev libgeos-3.3.3 libgeos-dev libgdal-dev gdal-bin libproj-dev binutils
wget http://postgis.refractions.net/download/postgis-2.0.0.tar.gz
tar xfvz postgis-2.0.0.tar.gz
cd postgis-2.0.0
./configure
make
// create file:
sudo vim /usr/share/applications/intellij.desktop
// add the following
[Desktop Entry]
Version=13.0
Type=Application
Terminal=false
Icon[en_US]=/home/kernelp4nic/Software/idea-IC-145.1617.8/bin/idea.png
Name[en_US]=IntelliJ