Skip to content

Instantly share code, notes, and snippets.

View ingydotnet's full-sized avatar

Ingy döt Net ingydotnet

View GitHub Profile
bin/
doc/
ext/ (submodules, subrepos)
lib/
test/
Changes
License
Makefile
Package
ReadMe
@ingydotnet
ingydotnet / gist:8484564
Last active January 3, 2016 15:39
IO::All this crap to mst, frew, and Mithaldu

This is this a little doc to talk about how IO::All should behave in a more perfect implementation:

First we support these variations, from formal, to whipitup.

# All the same:
use IO::All;
IO::All::File->new(pathname => 'foo.txt')->open('w')->println('hello world')->close;
IO::All::File->new(pathname => 'foo.txt')->open('w')->println('hello world');
IO::All::File->new(pathname => 'foo.txt')->println('hello world');

IO::All->new->file('foo.txt')->println('hello world');

dots:
- repo: https://github.com/sharpsaw/loop-dots.git
- repo: https://github.com/wesQ3/ww-roll.git
install: ~/bin
skip: []
@ingydotnet
ingydotnet / gist:8010231
Created December 17, 2013 18:34
Two different API payloads with same ETag.
$ curl --request GET https://api.github.com/users/diakopter --dump-header head --output out --silent; sha1sum out; grep '"followers"' out; grep -E '^(Status|ETag)' head
6615b9213c14bab84b07bb114e6bcf9b52155fbb out
"followers": 12,
Status: 200 OK
ETag: "edb4efcefbfe4f1f2d9c86ae2ce739bd"
$ git hub follow diakopter
'ingydotnet' is now following 'diakopter'
$ curl --request GET https://api.github.com/users/diakopter --dump-header head --output out --silent; sha1sum out; grep '"followers"' out; grep -E '^(Status|ETag)' head
e31059b12b576ad2a1f15c2d7ee731a0eec53935 out
"followers": 13,
@ingydotnet
ingydotnet / gist:7477181
Created November 15, 2013 00:41
subtree
git subtree add --prefix .vim/bundle/tpope-vim-surround https://bitbucket.org/vim-plugins-mirror/vim-surround.git master --squash
git subtree pull --prefix .vim/bundle/tpope-vim-surround https://bitbucket.org/vim-plugins-mirror/vim-surround.git master --squash
git remote add durdn-vim-surround ssh://git@bitbucket.org/durdn/vim-surround.git
git subtree push --prefix=.vim/bundle/tpope-vim-surround/ durdn-vim-surround master
@ingydotnet
ingydotnet / 1.tml
Last active December 27, 2015 23:39
# Snippet from https://github.com/ingydotnet/testml-tml/blob/master/function.tml
test1 = (f, c, t) {
List(f, '->', c).Join == t
t.Strip(f).Strip('->') == c
t.Strip('->') == List(f, c).Join
}
test1.Type == 'Func'
@ingydotnet
ingydotnet / 1-test1.tml
Last active December 27, 2015 23:29
TestML, JSON/AST, Quisp
# This is a real TestML code snippet from:
# https://github.com/ingydotnet/testml-tml/blob/master/arguments.tml
Plan = 3
*what.combine(*who) == *greeting
*what.combine('and', *else) == *greeting
*what.combine('and', *else.uppercase) == *upper_greeting
@ingydotnet
ingydotnet / gist:7373585
Created November 8, 2013 16:23
GitHub ETag still busted
> curl --request GET 'https://api.github.com/users/diakopter' --dump-header head --output out --silent; sha1sum out; echo "$(grep -Ec '^ *\{' out) followers"; grep -E '^(Status|ETag):' head; echo
e31e960f81c09c2e42d2d903f8d0f8ca7874b9b6 out
1 followers
Status: 200 OK
ETag: "0eb4a70d45390a53bcf157300ec99dd4"
> git hub follow diakopter
'git hub follow' command successful
> curl --request GET 'https://api.github.com/users/diakopter' --dump-header head --output out --silent; sha1sum out; echo "$(grep -Ec '^ *\{' out) followers"; grep -E '^(Status|ETag):' head; echo
c374f6afea25a7d483b1c95270726ba1675bb84e out
@ingydotnet
ingydotnet / report.md
Last active December 27, 2015 14:09
My Report -- Wednesday, November 6, 2013 AD

Regarding the templating of weechat conf files:

I think this is a great example of how to combine:

I coded up the YAML real tasty (DRY), and then wrote code in tt2 to slice it up various ways, thus avoiding any auxiliary Perl helper script. All in all, pretty elegant.

@ingydotnet
ingydotnet / Feature:README-extension.md
Last active December 26, 2015 18:08
Feature request: README extensions detected from symlink

Hi guys,

I always hated that I have to add a filetype extension like .markdown or whatever. It would be nice if there was another way to detect the filetype, and just call the file README.

I just thought of a way to do this where nobody loses.

I often symlink my README.md file to a file call doc/my-project.md. And you guys render that as markdown. Great!

Since it's a symlink you can get the extension from the referent file (doc/whatever.ext) and I can call the file just README!