Skip to content

Instantly share code, notes, and snippets.

@jqno
jqno / anagrams.bas
Created October 12, 2011 20:46
Anagram generator from Umberto Eco's novel Foucault's Pendulum
10 REM anagrams
20 INPUT L$(1),L$(2),L$(3),L$(4)
30 PRINT
40 FOR I1=1 TO 4
50 FOR I2=1 TO 4
60 IF I2=I1 THEN 130
70 FOR I3=1 TO 4
80 IF I3=I1 THEN 120
90 IF I3=I2 THEN 120
100 LET I4=10-(I1+I2+I3)
@jqno
jqno / .gitignore
Created October 16, 2011 15:27
Ignore file for Android Scala development using SBT
target/
lib_managed/
src_managed/
project/boot/
project/build/target/
project/plugins/target/
project/plugins/lib_managed/
project/plugins/src_managed/
@jqno
jqno / keytool.sh
Created December 19, 2011 18:44
Generate a private key for deployment to Android Market
keytool -genkey -v -keystore ~/.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
@jqno
jqno / BoxTest.scala
Created March 1, 2012 20:51
Symmetry of Box's equals method
package net.liftweb.common
import org.junit.runner.RunWith
import org.scalatest.FlatSpec
import org.scalatest.junit.JUnitRunner
import org.scalatest.matchers.ShouldMatchers
@RunWith(classOf[JUnitRunner])
class BoxTest extends FlatSpec with ShouldMatchers {
val foo = "foo"
@jqno
jqno / vimrc.local.vim
Created March 11, 2012 21:22
vimrc.local
if has('win32') || has('win64')
set runtimepath+=$HOME/Dropbox/config/vim
source ~\Dropbox\config\vim\vimrc.vim
else
set runtimepath+=~/Dropbox/config/vim
source ~/Dropbox/config/vim/vimrc.vim
endif
# Add the following line to ~/.bashrc:
# . /path/to/this/script/run.sh script_folder
# For example:
# . ~/Dropbox/config/bash/run.sh session
# Don't forget the dot!
for f in `dirname ${BASH_SOURCE[0]}`/$1/*; do
. $f
done
import org.parboiled.scala._
import org.parboiled.errors.ErrorUtils
import org.junit.runner.RunWith
import org.scalatest.FlatSpec
import org.scalatest.junit.JUnitRunner
import org.scalatest.matchers.ShouldMatchers
@RunWith(classOf[JUnitRunner])
class IsolationTest extends FlatSpec with ShouldMatchers {
val input = "abcdxyz"
function _fancy_prompt {
local RED="\[\033[01;31m\]"
local GREEN="\[\033[01;32m\]"
local YELLOW="\[\033[01;33m\]"
local BLUE="\[\033[01;34m\]"
local WHITE="\[\033[00m\]"
local PROMPT=""
# Working directory
@jqno
jqno / SchoolTest.java
Created February 14, 2013 12:45
My answer to Cedric Beust's coding challenge ("Light" edition) http://beust.com/weblog/2013/02/13/coding-challenge-light-edition/
// My implementation of Cedric Beust's coding challenge:
//
// A School has either a name (“Stanford”) or a nickname (“UCSD”) or both.
//
// Your task is to write equals() and hashCode() methods for the School class
// that satisfy the following requirement: two Schools are identical if they
// either have the same name or the same nickname.
//
// http://beust.com/weblog/2013/02/13/coding-challenge-light-edition/
@jqno
jqno / MyObjectTest.java
Created July 3, 2015 13:09
CGLib IntelliJ NonNull issue
import net.sf.cglib.proxy.Enhancer;
import net.sf.cglib.proxy.NoOp;
import org.jetbrains.annotations.NotNull;
import org.junit.Test;
public class MyObjectTest {
@Test
public void shouldVerifyHashCodeEquals() {
Enhancer e = new Enhancer();