Skip to content

Instantly share code, notes, and snippets.

@rosado
rosado / lpa_log.json
Created July 29, 2024 15:49
lnav format for lpa project
{
"$schema": "https://lnav.org/schemas/format-v1.schema.json",
"lpa_log": {
"title": "LPA Data Validator Combined Log",
"file-pattern": "combined.log",
"multiline": false,
"json": true,
"timestamp-field": "timestamp",
"level-field": "level",
"body-field": "message",
@rosado
rosado / clipboard.sh
Created April 15, 2022 07:55
copy & paste
# Source: https://gist.github.com/RichardBronosky/56d8f614fab2bacdd8b048fb58d0c0c7
# Linux
_copy(){
cat | xclip -selection clipboard
}
_paste(){
xclip -selection clipboard -o
}
@rosado
rosado / try-tagged.clj
Last active November 19, 2020 15:05
try-tagged macro
(defn- try-tagged-template
[tag-test catch-symbol & body]
(let [catch-tagged-form (last body)
[catch-sym ex tag data-sym & catch-body] catch-tagged-form]
(s/validate [(s/one (s/eq catch-symbol) 'catch)
(s/one s/Symbol 'exception-binding)
(s/one s/Keyword 'tag)
(s/one s/Symbol 'ex-data-binding)]
[catch-sym ex tag data-sym])
`(let [tag-test# ~tag-test
@rosado
rosado / r3.js
Created July 3, 2020 18:45
Radio 3 bookmarklet for radio3.io
javascript:(function(){
function encode (s) {
s = s.toString ();
s = s.replace (new RegExp (/" %"/, "g"), " percent");
return (encodeURIComponent(s));
}
var url="http://radio3.io/?";
var link = "link=" + encode(location.href);
var title="&title=" + (document.title);
var desc="&description=" + (document.getSelection());
@rosado
rosado / README.md
Created March 17, 2019 16:36
SCRIPT-8
@rosado
rosado / kismet.sh
Created April 25, 2018 19:37
kismet on r-pi setup instructions
sudo apt-get install git-core build-essential
sudo apt-get install libncurses5-dev libpcap-dev libpcre3-dev libnl-dev libmicrohttpd12 libmicrohttpd-dev
wget http://kismetwireless.net/code/kismet-2016-07-R1.tar.xz
tar -xvf kismet-2016-07-R1.tar.xz
cd kismet-2016-07-R1
./configure
make
sudo make suidinstall
sudo groupadd kismet
sudo usermod -a -G kismet pi
@rosado
rosado / inline-css.js
Created November 17, 2016 20:15
inline-css
var options = {
'url': '/foo/bar/'
}
var inlineCss = require('inline-css')
var fs = require('fs')
fs.readFile('/Users/foo/Downloads/index.htm', 'utf8', function (err, data){
if (err){
return console.log(err);
}
inlineCss(data, options).then(function(html) {
@rosado
rosado / Makefile
Last active February 2, 2022 00:41
test if directory exists in a makefile
all: txtfile
TARGET_DIR = target-dir
txtfile: $(TARGET_DIR)
touch $(TARGET_DIR)/file.txt
target-dir:
test ! -d $(TARGET_DIR) && mkdir $(TARGET_DIR)
@rosado
rosado / gist:12ef6afad830236b7330
Created December 4, 2015 10:05
Sublime Text bindings for Home/End on Mac OS X
[
{ "keys": ["end"], "command": "move_to", "args": {"to": "eol"} },
{ "keys": ["home"], "command": "move_to", "args": {"to": "bol"} },
{ "keys": ["shift+end"], "command": "move_to", "args": { "to": "eol", "extend": true } },
{ "keys": ["shift+home"], "command": "move_to", "args": { "to": "bol", "extend": true } }
]
@rosado
rosado / jvm options
Created October 21, 2015 12:05
JVM opts from clojure-users group
;; https://groups.google.com/forum/#!topic/clojure/JgxFQLP2E34
:jvm-opts ^:replace ["-server"
;;"-XX:+AggressiveOpts"
;;"-XX:+UseFastAccessorMethods"
;;"-XX:+UseCompressedOops"
"-Xmx4g"]