Skip to content

Instantly share code, notes, and snippets.

Jason Rogers jacaetevha

Block or report user

Report or block jacaetevha

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View error.md

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 Jun 11, 2019
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`
View Folding.java
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"));
View RubyScripting.java
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;
View .gitconfig
[user]
name = ...
email = ...
[core]
editor = vim
autocrlf = input
safecrlf = false
[alias]
co = checkout
ci = commit
@jacaetevha
jacaetevha / app.rb
Last active Oct 26, 2017
Sample Sinatra application
View app.rb
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 Oct 20, 2017
Maven settings file for ISS projects
View settings.xml
<?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 Nov 27, 2017
editable text area in a browser tab (for use in creating templatized Slack notes)
View gist:a9dfeb5183cd38e07037844073cee39c
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 Apr 26, 2016
BASH script to en-/decrypt a file with GPG
View privacy.sh
#!/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%.*})
@jacaetevha
jacaetevha / _README.textile
Last active Aug 29, 2015
Population Count functions
View _README.textile

The population count function is used in many different scenarios. I first found out about it in the implementation of a HAMT data structure (Hash Array Mapped Trie).

The implementations herein are converted to Ruby from the C functions in this article. MRI is generally faster at these implementations than JRuby, but JRuby shines when any of these functions are called frequently enough to be able to inline the functions.

Platform information

OS Yosemite 10.10.4
Machine MacBook Pro (13-inch, Late 2011)
Processor 2.4 GHz Intel Core i5
Memory 16 GB 1333 MHz DDR3
@jacaetevha
jacaetevha / pharo
Created Jun 4, 2015
Enhancements to Pharo ZeroConf Bash scripts
View pharo
#!/usr/bin/env bash
# some magic to find out the real location of this script dealing with symlinks
DIR=`readlink "$0"` || DIR="$0";
DIR=`dirname "$DIR"`;
cd "$DIR"
DIR=`pwd`
cd - > /dev/null
# disable parameter expansion to forward all arguments unprocessed to the VM
set -f
if [[ "$1" = "*.image" ]]; then
You can’t perform that action at this time.