Skip to content

Instantly share code, notes, and snippets.

Avatar
🍍
Still Elixirin'

Dave Lucia davydog187

🍍
Still Elixirin'
View GitHub Profile
View enum.ex
defmodule App.Ecto.Atom do
@moduledoc """
Generates an Ecto custom type for atoms.
e.g.
defmodule MyType do
use App.Ecto.Atom, values: [:one, :two, :three]
end
View keybase.md

Keybase proof

I hereby claim:

  • I am davydog187 on github.
  • I am davydog187 (https://keybase.io/davydog187) on keybase.
  • I have a public key ASCubMQiKyFLw51a6aaD4uJXgcFPAhFbgDwoHgPd-bNEjAo

To claim this, I am signing this object:

View .spacemacs
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
@davydog187
davydog187 / .spacemacs
Created Dec 4, 2018
Dave's .spacemacs file 12/4/18
View .spacemacs
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
@davydog187
davydog187 / .bashrc
Created Jan 20, 2018
Edited bashrc for ubuntu
View .bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@davydog187
davydog187 / .vimrc
Created Jan 20, 2018
Stripped down vimrc for ubuntu
View .vimrc
" .vimrc
" !silent is used to suppress error messages if the config line
" references plugins/colorschemes that might be missing
" Disable Vi compatibility
set nocompatible
if has("autocmd")
" Load files for specific filetypes
@davydog187
davydog187 / gist:facf3181d8ff5e9371f931b42ca4bc86
Last active Sep 22, 2016
digiday remove filter bookmartlet
View gist:facf3181d8ff5e9371f931b42ca4bc86
javascript:(function() {const ads = Array.from(document.querySelectorAll(".ad-wrapper")).forEach(ad => ad.parentNode.removeChild(ad));const blur = Array.from(document.querySelectorAll(".entry-content")).forEach(thing => thing.style.webkitFilter = "none");})();
@davydog187
davydog187 / prototype.js
Created Oct 21, 2015
explain how prototype works
View prototype.js
function test() {}
test.prototype.number = 5;
var a = new test
var b = new test
b.number // 5
b.hasOwnProperty("number") // false <- false because number is on the prototype
b.number = 10 // now were assigning to number, putting it on the instance
View bootstrap.js
function makeBootstrappingLoader(scriptBody, clientAppUrl, isAsync) {
var loadAsync = isAsync ? "s.async = true;\n" : "";
return "<script type=\"text/javascript\">\n" +
"var s = document.createElement(\"script\");\n" +
"s.setAttribute(\"src\", \"" + clientAppUrl + "\");\n" +
"document.body.insertBefore(s, null)\n"+
loadAsync +
"function loaded(e) {\n" +
scriptBody + "\n" +
"s.removeEventListener(\"load\", loaded, false);\n" +
@davydog187
davydog187 / gpt-leak.html
Created May 13, 2015
GPT Related Memory Leak
View gpt-leak.html
<html>
<head>
<title>GPT Test Page</title>
</head>
<body>
<div id="01dff7272bfc464224240bc6f1f8d25b"></div>
<button id="refresh">Clear and Refresh</button>
<span>Times refreshed: </span><span id="times">0</span>