This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defmodule Finder do | |
| def run do | |
| "find . | grep 'lib/' | grep -v 'deps/'" | |
| |> cmd() | |
| |> String.split("\n") | |
| |> Enum.filter(&String.ends_with?(&1, ".ex")) | |
| |> Enum.map(&find_test_file/1) | |
| |> Enum.map(&find_tests/1) | |
| |> Enum.filter(&has_missing_tests/1) | |
| |> Map.new() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defmodule MixTests do | |
| @commands [ | |
| "git diff --name-only", | |
| "git diff --cached --name-only", | |
| "git diff --name-only ..develop", | |
| "git ls-files --others --exclude-standard", | |
| ] | |
| def files_to_run do | |
| @commands |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM haskell:7.8.4 | |
| RUN apt-get update && apt-get --assume-yes install graphviz vim curl git | |
| RUN cabal update && cabal install graphviz parsec text && cabal install erd | |
| COPY graph.in . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| \set QUIET 1 | |
| \pset null 'ø' | |
| \x auto | |
| \set QUIET 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Memoizable | |
| module ClassMethods | |
| @@memoizable = Hash.new | |
| def memoize(method_name, &block) | |
| define_method(method_name) do |*args| | |
| puts @@memoizable | |
| @@memoizable["#{self.class.name}|#{method_name}|#{args}"] ||= block.call(*args) | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Code | |
| class << self | |
| def print(clazz, class_method: nil, instance_method: nil) | |
| method = class_method ? clazz.method(class_method) : clazz.instance_method(instance_method) | |
| puts read_method(*method.source_location) | |
| end | |
| private | |
| def read_method(path, line) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| brew update; | |
| brew outdated; | |
| brew upgrade; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function $(selector) { | |
| return document.querySelectorAll(selector); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Array.prototype.uniq = function(){ return $.unique(this.sort()); }; | |
| log = (msg, bg, c)=> console.log('%c'+msg, 'background: '+bg+'; color: '+c); | |
| classes = $('.highlighter-rouge pre code span').map((_,x)=> $(x).attr('class')).toArray().uniq(); | |
| languages = $('.highlighter-rouge .header').map((_,x)=> $(x).data('lang')).toArray().uniq(); | |
| classes.forEach(function(css){ | |
| log('=> '+css+' ','#eee8d5','#268bd2'); | |
| languages.forEach(function(lang){ | |
| log(' '+lang+' ', '#eee8d5','#2aa198'); | |
| nodes = $('.highlighter-rouge.language-'+lang+' pre code span.'+css); | |
| texts = nodes.map((_,x)=> $(x).text()).toArray().uniq(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var selector = 'h2 a'; | |
| var list = document.querySelectorAll(selector); | |
| console.log('#elements to click', list.length); | |
| list.forEach(function(el, i){ | |
| new Promise((resolve) => setTimeout(resolve, 1000*i)).then(() => { | |
| console.log(i, el); | |
| el.click(); | |
| }); | |
| }); |
NewerOlder