Skip to content

Instantly share code, notes, and snippets.

View rrrene's full-sized avatar
👶
Chasing a toddler. I may be slow to respond.

René Föhring rrrene

👶
Chasing a toddler. I may be slow to respond.
View GitHub Profile
@henrik
henrik / regex_case.exs
Last active September 21, 2022 03:06
Proof-of-concept of an Elixir construct like `case` but that matches strings against regexps. #elixirlang
defmodule RegexCase do
defmacro regex_case(string, do: lines) do
new_lines = Enum.map lines, fn ({:->, context, [[regex], result]}) ->
condition = quote do: String.match?(unquote(string), unquote(regex))
{:->, context, [[condition], result]}
end
# Base case if nothing matches; "cond" complains otherwise.
base_case = quote do: (true -> nil)
new_lines = new_lines ++ base_case
@dogoku
dogoku / A README.md
Last active December 29, 2022 02:58 — forked from tiffon/Find Results.hidden-tmLanguage
Search result syntax highlighting for Sublime Text

#ST2/3 Search result syntax highlighting

##Introduction and disclaimer

This is gist contains an edited Find Results.hidden-tmLanguage which adds syntax highlighting to your ST search results. As far as I know, there is no plugin that does this and for that reason it needs to be done via config.

DISCLAIMER: Use this HACK at your risk and backup the original files you are about to mess with.

##Usage Guide for Sublime Text 2

@nrrrdcore
nrrrdcore / inset_input.css
Created August 9, 2012 23:35
The Perfect Inset Input CSS
input {
height: 34px;
width: 100%;
border-radius: 3px;
border: 1px solid transparent;
border-top: none;
border-bottom: 1px solid #DDD;
box-shadow: inset 0 1px 2px rgba(0,0,0,.39), 0 -1px 1px #FFF, 0 1px 0 #FFF;
}