Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am gnusosa on github.
  • I am cisosa ( on keybase.
  • I have a public key ASAsa-sXDuH0lC644fAHbqcJwmbZ3xFRGH-Hegycs2ZMGwo

To claim this, I am signing this object:

{-# LANGUAGE FlexibleContexts #-}
import qualified Data.Text as Text
import qualified Data.Text.Read as Text
import qualified Data.Text.IO as Text
import qualified Data.Either as Either
import qualified Data.List as L
import qualified Data.Map.Strict as Map
import Data.Maybe
counter = Map.fromList [("horizontal", 0), ("depth", 0), ("aim", 0)]
sweeps :: [Integer]
sweeps = [199,
gnusosa / hlischeme.hs
Last active March 12, 2020 04:38
Haskell's Little Scheme Intepreter
{-# LANGUAGE ExistentialQuantification #-}
import Text.ParserCombinators.Parsec hiding (spaces)
import System.Environment
import Control.Monad
import Control.Monad.Except
import System.IO
symbol :: Parser Char
symbol = oneOf "!#$%&|*+-/:<=>?@^_~"
gnusosa / yubikey-get-oath.el
Last active March 15, 2019 23:27
Get Yubikey OATH token from ykman with Ivy - Emacs
(defcustom ykman-path "/usr/local/bin/ykman"
"Set this to the path of the command line ykman client for your OS.")
(defun yubikey-get-oath ()
"Copy a OATH token to your kill-ring"
(let ((ivy-hash (make-hash-table :test 'equal))
(cb (lambda (choice)
gnusosa /
Created April 27, 2018 04:25
JavaFX Reader to Text Area
package org.gnusosa;
import java.util.ArrayList;
import java.util.Scanner;
public class ReadText extends FileManager {
private Scanner scanner;
gnusosa /
Last active April 27, 2018 01:20
Panagram JavaFX
package sample;
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
String recordId = statData.getRecId();
if ((recordId.equals("PT")) || // OS390 Pnode Process End
(recordId.equals("ZT")) || // OS390 Snode Process End
(recordId.equals("PRED")) || // UNIX & Windows Process End
(recordId.equals("USEC"))) { // UNIX & Windows security error
gnusosa / erc-subword-fix-emacs-HEAD.patch
Created August 27, 2015 17:56
Erc blows out in Emacs 25.0.50 with the change to subword-mode. See
From 3017aba1093c8f57d3a3b7193692d62a56b68d3b Mon Sep 17 00:00:00 2001
From: Dima Kogan <dima@HIDDEN>
Date: Tue, 30 Dec 2014 23:29:21 -0800
Subject: [PATCH] ERC no longer gets confused by subword-mode
In commit 6ddc44225e743e2b2a0d5c192f50aefd7a4a915b subword-mode was
integrated into the syntax table instead of simply remapping the
interactive motion bindings as was done previously. This had the
unintended effect of changing the behavior of lisp programs that touch
words. In the case of ERC, it completely broke it: emacs now throws an
== 20130612005642 TranslateCustomFieldAttributes: migrating ===================
-- table_exists?(:custom_field_attribute_translations)
-> 0.0005s
-- index_exists?("custom_field_attribute_translations", ["custom_field_attribute_id"])
-> 0.0003s
-- add_index("custom_field_attribute_translations", ["custom_field_attribute_id"], {:name=>"index_custom_field_attribute_translations_on_cfa_id"})
rake aborted!
StandardError: An error has occurred, all later migrations canceled:
Index name 'index_custom_field_attribute_translations_on_cfa_id' on table 'custom_field_attribute_translations' already exists/home/gnusosa/.rbenv/versions/2.1.3/gemsets/coupa/gems/activerecord-4.0.12/lib/active_record/connection_adapters/abstract/schema_statements.rb:819:in `add_index_options'