Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am twelve17 on github.
  • I am alexporras (https://keybase.io/alexporras) on keybase.
  • I have a public key ASCdWYHmNXBitEmJzkvNB6M0dcvcdNHJ43mWzuL6UA3fLgo

To claim this, I am signing this object:

@twelve17
twelve17 / association_spec.rb
Last active October 14, 2017 15:31
order_query - sorting by association
require 'spec_helper'
require 'active_record'
require 'order_query'
require 'pry-byebug'
RSpec.describe OrderQuery do
class Employee < ActiveRecord::Base
include OrderQuery
has_one :contract
@twelve17
twelve17 / openssl_format_for_puttygen.md
Last active November 30, 2021 06:17
Formatting OpenSSL keys for PuTTY Gen Conversion

It looks like as of this writing, the PuTTY Gen conversion code only accepts keys that use the AES-128-CBC or DES-EDE3-CBC ciphers. Otherwise, it will complain with a "unsupported cipher" error. (The latest release version at the moment is beta 0.67.)

For example, one of my private keys was using AES-256-CBC:

-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: AES-256-CBC,xxxxxxx
diff --git a/config/openalpr.conf b/config/openalpr.conf
index 17b6af9..8f36e4e 100644
--- a/config/openalpr.conf
+++ b/config/openalpr.conf
@@ -1,7 +1,7 @@
[common]
; Specify the path to the runtime data directory
-runtime_dir = /usr/share/openalpr/runtime_data
+runtime_dir = ${CMAKE_INSTALL_PREFIX}/share/openalpr/runtime_data
@twelve17
twelve17 / MyActivity.java
Last active August 29, 2015 14:06
Workaround for Android Issue 14616: ActivityUnitTestCase crashes when dialogs are spawned.
public class MyActivity extends Activity {
public void methodTriggeredFromASomeAction(View view) {
final ProgressDialogFragment pDialogFragment = ProgressDialogFragment.newInstance("Dialog Text..");
pDialogFragment.show(getFragmentManager(), "dialog");
//...
pDialogFragment.dismiss();
}
}