Skip to content

Instantly share code, notes, and snippets.

@jacaetevha
jacaetevha / rails_log_sql_extractor.sh
Created June 20, 2012 15:28
a quick BASH script to parse times and SQL statements out of a Rails log
#!/bin/bash
#################################################################
# #
# I don't typically use this on an entire Rails log file, #
# I usually copy out portions of the log that I am interested #
# in and then run it through this script. While this script #
# will work on the bare Rails log I don't recommend it, since #
# the Rails log includes color formatting information and can #
# be quite large. #

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:

@jacaetevha
jacaetevha / gist:3795784
Created September 27, 2012 19:02
Smalltalk syntax on a postcard
exampleWithNumber: x
"A method that illustrates every part of Smalltalk method syntax
except primitives. It has unary, binary, and keyword messages,
declares arguments and temporaries, accesses a global variable
(but not and instance variable), uses literals (array, character,
symbol, string, integer, float), uses the pseudo variables
true false, nil, self, and super, and has sequence, assignment,
return and cascade. It has both zero argument and one argument blocks."
@jacaetevha
jacaetevha / terminator-config
Created February 1, 2012 22:22
save this file to ~/.config/terminator/config
[global_config]
enabled_plugins = CustomCommandsMenu, InactivityWatch, TestPlugin, ActivityWatch, TerminalShot, LaunchpadCodeURLHandler, APTURLHandler, MavenPluginURLHandler, LaunchpadBugURLHandler, LayoutManager
title_transmit_bg_color = "#832527"
[keybindings]
[profiles]
[[default]]
scrollback_lines = 4000
[layouts]
[[default]]
[[[child1]]]
@jacaetevha
jacaetevha / login-hook.sh
Created June 3, 2012 03:37
Mac OS/X login/logout hooks to save login/logout information to a Mongo DB
#!/bin/bash
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
MONGO="${MONGO:-/usr/local/bin/mongo}"
MONGO_USER='<mongo username>'
MONGO_PWD='<mongo password>'
MONGO_URL="<database server>:<port>/<database name>"
#!/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