Skip to content

Instantly share code, notes, and snippets.

@mankyKitty
mankyKitty / SolrQuerySyntaxPrimer.md
Last active March 19, 2024 07:52
The documentation around the basics of the Solr query syntax is terrible, this is an attempt to alleviate the doc-shock associated with trying to learn some fundamentals.

Solr Query Syntax Basics

This is a super basic beginners guide to Solr Lucene query syntax. We're going to cover running a straightforward query, as well as some of the more useful functionality such as filtering and creating facets. We'll point out some things you can't do and generally give you enough instruction so that you can get yourself into trouble.

For testing you need a REST client capable of sending requests to your Solr instance. Either RESTClient for Firefox or Postman for Chrome are good choices.

Misc

Request Specific Fields

To specify a list of fields to return instead of the default Solr response use fl and provide a comma delimited list of fields:

x ← ⊜□ ≠@\n.&fras "aoc_inputs/day1"
# remove all the non-numeric characters
# take first and last
# parse to number
# sum them all
# DayOnePartOne ← /+∵(⋕⊂⊃⊢(⊢⇌)▽<@a.°□)
# DayOnePartOne x
Wrd ← {"one" "two" "three" "four" "five" "six" "seven" "eight" "nine"}
@mankyKitty
mankyKitty / picosystem-rs-env.nix
Created February 26, 2022 11:29
nix shell for building picosystem-rs things (https://github.com/rlane/picosystem-rs)
{ srcs ? import ./nix/sources.nix }:
let
pkgs = import srcs.nixpkgs {
crossSystem = (import "${srcs.nixpkgs}/lib").systems.examples.raspberryPi // {
rustc.config = "thumbv6m-none-eabi";
};
};
in
pkgs.mkShell {
@mankyKitty
mankyKitty / ViewsHandlersShakedown.md
Last active October 27, 2021 05:32
This is a cheat sheet for information about extending the capabilities of Views by extending and building your own handlers. It will cover the basic handlers and attempt to cover some of the hooks that you might use when doing so. Including examples, basic documentation and some caveats where necessary.THIS IS NOT A COMPLETE LIST!! Consider the …

#Views Handlers - A Shakedown

This is a cheat sheet for information about extending the capabilities of Views by extending and building your own handlers. It will cover the basic handlers and attempt to cover some of the hooks that you might use when doing so. Including examples, basic documentation and some caveats where necessary. THIS IS NOT A COMPLETE LIST!! Consider the code of the handler your looking to extend to be the ultimate source of documentation. This is merely a convenience and a starting point.

_Ignore the tags in the included snippets, they are a convenience for formatting.

Extending / Including Your Handler

  • Determine which handler you're going to extend. (eg views_handler_field_numeric).
  • Create a PHP .inc file using the class name of your handler: views_handler_field_my_numeric_field.inc.
@mankyKitty
mankyKitty / keybase.md
Created October 20, 2020 09:36
keybase.md

Keybase proof

I hereby claim:

  • I am mankykitty on github.
  • I am mankykitty (https://keybase.io/mankykitty) on keybase.
  • I have a public key ASDlqloTvjxMh_TqV6vXnG9Sw6gZKXsLCUm-S6Sb6AOCqgo

To claim this, I am signing this object:

@mankyKitty
mankyKitty / spiders.hs
Created February 18, 2020 15:30
Property test a reflex FRP function
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
module Main where
import Debug.Trace
import Control.Monad.IO.Class (liftIO, MonadIO)
import Control.Lens hiding ((|>))
import Control.Monad.State (execStateT, modify)
import Control.Monad
@mankyKitty
mankyKitty / new_hotness.hs
Created February 10, 2020 09:38
Tobasco In Your Coffee Machine Testing Properties.
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE TemplateHaskell #-}
module CoffeeMachineTestsNew where
import Control.Lens
import Control.Monad.State (MonadState, execStateT)
import Control.Monad.IO.Class (MonadIO)
import Data.Foldable (for_)
@mankyKitty
mankyKitty / bem.hs
Last active October 25, 2019 12:24
Type level BEM declarations because why not....
data CSS_BEM (block :: Symbol) = CSS_BEM
{ cssBEMBlock :: Text
, cssBEMElem :: Text -> Text
, cssBEMMod :: Text -> Text
, cssBEMElemMod :: Text -> Text -> Text
}
mkCSSBEM :: forall t. KnownSymbol t => CSS_BEM t
mkCSSBEM = CSS_BEM @t tb (mappend tb__) (mappend (tb <> "--")) (\e m -> tb__ <> e <> "--" <> m)
where
@mankyKitty
mankyKitty / miniadapton.scm
Created October 7, 2019 04:52
weeeeeeeeeeeeeeeeeeeee
;; The mini-set implementation
(define empty-set '())
(define (set-mem e s)
(memv e s))
(define (set-cons e s)
(if (set-mem e s) s (cons e s)))
(define (set-rem e s)
(filter (lambda (x) (not (eqv? e x))) s))
(define (set-union s1 s2)
(fold-left set-cons s2 s1))