Skip to content

Instantly share code, notes, and snippets.

@LukeWinikates
LukeWinikates / git-history-prose
Created Oct 23, 2014
turns git log messages into a running blob of text
View git-history-prose
#! /usr/bin/ruby
lines = `git log --format=oneline`.lines.reverse
result = lines.map { |l| ws = l.split(" ").drop(1) }.map do |line|
line.join " "
end.join(". ").send(:+, ".").gsub("\.\.", ".")
puts result
View keybase.md

Keybase proof

I hereby claim:

  • I am lukewinikates on github.
  • I am lwinikates (https://keybase.io/lwinikates) on keybase.
  • I have a public key whose fingerprint is AC5F 7444 8560 9905 7128 38E9 AE14 2850 289E 14F4

To claim this, I am signing this object:

View .gitignore
# See http://help.github.com/ignore-files/ for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile ~/.gitignore_global
# Ignore bundler config
/.bundle
# Ignore the default SQLite database.
View .gitignore
# See http://help.github.com/ignore-files/ for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile ~/.gitignore_global
# Ignore bundler config
/.bundle
# Ignore the default SQLite database.
@LukeWinikates
LukeWinikates / go.grcconf
Created Feb 17, 2013
grc config file for go text / gocheck output, to make failing tests pop out more
View go.grcconf
regexp=FAIL:?
colours=red
count=more
-
regexp=PASS:?
colours=green
count=more
-
regexp=/[\w/\.]+:\d+
colours=blue
@LukeWinikates
LukeWinikates / from-dropdowns
Created Dec 31, 2012
Quotation from bootstrap dropdowns.less
View from-dropdowns
// Links within the dropdown menu
li > a {
display: block;
// ...etc
}
@LukeWinikates
LukeWinikates / posts.json
Created Dec 31, 2012
Example of liquid template for generating JSON -- not pretty, but effective
View posts.json
---
---
[
{% for post in site.posts %}
{ "title": "{{ post.title }}", "url": "{{ post.url}}" },
{% endfor %}
null
]
@LukeWinikates
LukeWinikates / EqualityExtender.cs
Created Jun 2, 2012
Sometimes, IEnumerable<T>.Any() is the opposite of what you want...
View EqualityExtender.cs
public static class EqualityExtender
{
/// <summary>
/// Sometimes you want to say this.Name = "Bob" or "Fran". Linq lets you do:
/// new[]{"Fran", "Bob"}.Any(n=> n == this.Name);
///
/// but isn't it nicer to do:
///
/// this.Name.EqualsAnyOf(new[]{"Bob", "Fran"});
/// </summary>