Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am jacaetevha on github.
  • I am jacaetevha (https://keybase.io/jacaetevha) on keybase.
  • I have a public key ASBfefx-n8qEFzgBsGYtvKfHlsemPt6xg2ebh2mVh4XJYwo

To claim this, I am signing this object:

#!/usr/bin/env bash
mkdir -p common
mkdir -p app
mkdir -p config
mkdir -p bin
mkdir -p dist
cat <<RB > config/warble.rb
Warbler::Config.new do |config|

JRuby Information:

jruby 9.2.8.0 (2.5.3) 2019-08-12 a1ac7ff Java HotSpot(TM) 64-Bit Server VM 25.202-b08 on 1.8.0_202-b08 +jit [linux-x86_64]

Error:

[someone@somehost]$ java -Djruby.native.verbose=true -jar dbconsole-1.0.3.jar
Failed to load native POSIX impl; falling back on Java impl. Stacktrace follows.
java.lang.UnsatisfiedLinkError: could not load FFI provider jnr.ffi.provider.jffi.Provider
@jacaetevha
jacaetevha / Folding.java
Last active June 11, 2019 16:19
Some simple benchmarking of Truffle Ruby, JRuby, and MRI Ruby doing `inject` and `fold` as compared to Java, GraalVM, and GraalVM native-image (implementing the `fold` as a `for-loop` and as a `stream+collect`
import java.util.*;
import java.util.stream.*;
import java.text.*;
import java.util.function.*;
public class Folding {
public static void main(String[] args) {
DecimalFormat formatter = new DecimalFormat("#.######");
int n = Integer.parseInt(System.getProperty("COUNT", "1000"));
int arraySize = Integer.parseInt(System.getProperty("ARRAY_SIZE", "10000"));
package com.xyz;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import javax.script.Bindings;
import javax.script.ScriptContext;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
@jacaetevha
jacaetevha / .gitconfig
Created April 13, 2018 14:25
Git config
[user]
name = ...
email = ...
[core]
editor = vim
autocrlf = input
safecrlf = false
[alias]
co = checkout
ci = commit
@jacaetevha
jacaetevha / app.rb
Last active October 26, 2017 22:49
Sample Sinatra application
get '/' do
erb :audio
end
get '/flac' do
send_file '../relative/path/to/file.flac', type: 'audio/flac', disposition: 'inline'
end
get '/mp3' do
send_file '/absolute/path/to/file.mp3', type: 'audio/mp3', disposition: 'inline'
@jacaetevha
jacaetevha / settings.xml
Created October 20, 2017 17:18
Maven settings file for ISS projects
<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<profiles>
<profile>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
@jacaetevha
jacaetevha / gist:a9dfeb5183cd38e07037844073cee39c
Last active November 27, 2017 15:11
editable text area in a browser tab (for use in creating templatized Slack notes)
data:text/html;charset=utf-8,<title>TextEditor</title><style>body{background:#fbfbfb;color:#333;margin:0%20auto;width:50rem}textarea{background:#fbfbfb;border:1px%20solid%20#ddd;color:#333;font-family:monospace;font-size:16px;height:90%;line-height:1.4;margin:0%20auto;outline:0;padding:4rem;width:100%;margin-top:1rem;}button{background-color:#fbfbfb;border:1px%20#ccc%20solid;color:#999;cursor:pointer;float:right;margin:10px%200;padding:5px%2010px}.fixed-top-right{position:fixed;top:0.4rem;right:8rem;}@media%20(max-width:768px){body{width:100%;padding:0}textarea{padding:10px}button{float:none}}</style><body><div%20class="fixed-top-right"><button%20onclick="sM();%20return%20false">New%20Section</button></div><textarea%20contenteditable%20id=TE%20spellcheck=true%20placeholder=Write...%20autofocus></textarea><script>var%20dates={};%20for(var%20i=1;i<32;i++){%20if(i<10){%20dates[i]="0"+i;%20}else{%20dates[i]=i;%20}%20};%20var%20days={6:"Mon",0:"Mon",1:"Mon",2:"Tue",3:"Wed",4:"Thu",5:"Fri"};%20var%20months={};%20fo
@jacaetevha
jacaetevha / privacy.sh
Created April 26, 2016 14:24
BASH script to en-/decrypt a file with GPG
#!/bin/bash
if [ "$1" == "--encode" ]
then
FILE=${2:-private.tar}
gpg --output $FILE.enc --symmetric --cipher-algo AES256 $FILE
elif [ "$1" == "--decode" ]
then
FILE=${2:-private.tar.enc}
FILE_BASENAME=$(basename ${FILE%.*})