Skip to content

Instantly share code, notes, and snippets.

View Dkendal's full-sized avatar

Dylan C. Kendal Dkendal

View GitHub Profile
#!/usr/bin/env elixir
for path <- Path.wildcard("_build/test/lib/*/.mix/.mix_test_failures", match_dot: true),
{{mod, name}, path} <-
path
|> File.read!()
|> :erlang.binary_to_term()
|> elem(1)
|> Map.to_list(),
grep_match <-
name
This file has been truncated, but you can view the full file.
--
-- PostgreSQL database dump
--
-- Dumped from database version 15.3
-- Dumped by pg_dump version 15.5
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
This file has been truncated, but you can view the full file.
--
-- PostgreSQL database dump
--
-- Dumped from database version 15.3
-- Dumped by pg_dump version 15.5
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
#!/usr/bin/env elixir
for path <- Path.wildcard("_build/test/lib/*/.mix/.mix_test_failures", match_dot: true),
{{mod, name}, path} <-
path
|> File.read!()
|> :erlang.binary_to_term()
|> elem(1)
|> Map.to_list(),
grep_match <-
name
@Dkendal
Dkendal / gzf.fish
Last active December 9, 2021 21:23
interactive git log file searcher
function gzf -a file
function help
echo "usage: gzf <file>"
end
# echo $file
if ! string match '^\.\/'
set file "./$file"
end
@Dkendal
Dkendal / builder-bookmarklet.js
Last active December 8, 2021 21:40
Lite version of the builder.io chrome extension for debugging purposes.
javascript:(function() {
/* https://stackoverflow.com/questions/7616461/generate-a-hash-from-string-in-javascript */
function hashCode(str) {
let hash = 0;
let i = 0;
const len = str.length;
while ( i < len ) {
hash = ((hash << 5) - hash + str.charCodeAt(i++)) << 0;
}
return hash;
defmodule Debug do
alias Rexbug.Printing
alias Rexbug.Printing.Call
alias Rexbug.Printing.MFA
alias Rexbug.Printing.Return
import Inspect.Algebra
import Kernel, except: [inspect: 1, inspect: 2]
@Dkendal
Dkendal / github.ex
Created September 24, 2020 18:41
more elixir metaprogramming
defmodule Core.Github do
@behaviour Core.Github.Adapter
for {fun, arity} <- Core.Github.Adapter.behaviour_info(:callbacks) do
args = Macro.generate_arguments(arity, __MODULE__)
@impl true
def unquote(fun)(unquote_splicing(args)) do
apply(adapter(), unquote(fun), unquote(args))
end
@Dkendal
Dkendal / vesionify.js
Last active December 5, 2018 17:05
Node js script to set exact dependencies based on what is installed in node_modules.
'use strict';
const fs = require('fs');
const pwd = process.cwd();
const pkg = require(`${pwd}/package.json`);
for (const key of [
'devDependencies',
'dependencies',
@Dkendal
Dkendal / italics.vim
Created January 10, 2018 20:21 — forked from fmoralesc/italics.vim
vim + italics
" cd to the folder where you have xterm-256color.terminfo, run
" $ tic xterm-256color.terminfo
" and add the following to your vimrc.
set t_ZH=
set t_ZR=