Skip to content

Instantly share code, notes, and snippets.

View ingydotnet's full-sized avatar

Ingy döt Net ingydotnet

View GitHub Profile
value and comment: hello # comment here
single line string: 'ok # not a comment' # this is a comment
double quoted: "this line has a newline at end\n"
literal: |
indented text
is 4 lines and
has leading spaces removed
all content # including the is part of the literal
number: 42
@ingydotnet
ingydotnet / gist:f4f9c8a10ece5b028cff
Created May 1, 2014 22:19
Why does a bad repository delete call return a 404?
$ git hub repo github/janky
Full Name github/janky
Description:
Continuous integration server built on top of Jenkins and Hubot
Language Ruby
GitHub Page https://github.com/github/janky
Remote URL git@github.com:github/janky.git
Forks 170
Stars 1974
Open Issues 18
my_list:
- foo
- bar
- >
my very long
list item
all on one line
- "my very long
list item
all on one line"
@ingydotnet
ingydotnet / gist:10952885
Created April 17, 2014 04:29
ETag not Changing
> curl --silent https://api.github.com/repos/aocole/skill-shot-list --dump-header head > out; echo; grep '^ETag' head; sha1sum out
ETag: "7b3a97ee2c14ca372c126dcc3773db1e"
816ebdfad5e3a0e5155f65ca8d44aa4dbbcdd79a out
> git hub unstar aocole/skill-shot-list
'aocole/skill-shot-list' unstarred
> curl --silent https://api.github.com/repos/aocole/skill-shot-list --dump-header head > out; echo; grep '^ETag' head; sha1sum out
ETag: "7b3a97ee2c14ca372c126dcc3773db1e"
ea2aab4fd641e6a6ffe37ecf4ab50b1737497fc5 out
@ingydotnet
ingydotnet / out.txt
Created April 16, 2014 11:12
Bug in API stargazers response header
> curl --silent https://api.github.com/repos/aocole/skill-shot-list/stargazers?per_page=10 --dump-header head; echo; grep -E '^Link: ' head
[
{
"login": "ingydotnet",
"id": 21826,
"avatar_url": "https://avatars.githubusercontent.com/u/21826?",
"gravatar_id": "8b3bd89d842c858bea279637e34b4382",
"url": "https://api.github.com/users/ingydotnet",
"html_url": "https://github.com/ingydotnet",
"followers_url": "https://api.github.com/users/ingydotnet/followers",
@ingydotnet
ingydotnet / nopaste
Last active August 29, 2015 13:57 — forked from dagolden/nopaste
# hack is a function
hack () {
local dir
if [ -d "$1" ]; then
dir="$1"
else
dir="$(perl -MPIR -wE 'my $iter=PIR->new->skip_vcs->directory->iname(shift)->iter("$ENV{HOME}/git"); say $iter->()' $1)"
fi
if [ -n "$dir" -a -d "$dir" ]; then
tmux new-window -c "$dir" -n "$(basename "$dir")"
@ingydotnet
ingydotnet / gist:8829950
Created February 5, 2014 18:22
From B.pm
sub B::IV::int_value {
my ($self) = @_;
return (($self->FLAGS() & SVf_IVisUV()) ? $self->UVX : $self->IV);
}
@ingydotnet
ingydotnet / gist:8674477
Created January 28, 2014 19:31
Alt-IO-All-2014
Releasing a popular module like IO::All under the dist Alt-IO-All-<tag> allows people to install a version of IO::All with a new experimental API, without worrying about introducing something that becomes a compatibility liability.
Alt-IO-All-2014 contains a placeholder no-op module called Alt::IO::All::2014 and also all the new IO::All modules. People can opt in to using it, but IO::All does not index to it.
This allows for a time period of real world testing/vetting.
With IO::All we want to break backwards compatibility. I want to reduce this as much as possible by making two usage forms:
use IO::All; # Make defaults as close to old as possible, and also subject to a deprecation schedule.
use IO::All -AnyOption; # Since we don't use (many at least) options now, an option means that you opt in to the new API.
@ingydotnet
ingydotnet / PIC
Last active January 4, 2016 14:48
#include <p16F690.inc>
__config (_INTRC_OSC_NOCLKOUT & _WDT_OFF & _PWRTE_OFF & _MCLRE_OFF & _CP_OFF & _BOR_OFF & _IESO_OFF & _FCMEN_OFF)
cblock 0x20
Delay1 ; Define two file registers for the
Delay2 ; delay loop
endc
#!/usr/bin/env perl
use Pegex::Parser;
use VIC::Grammar;
use VIC::Receiver;
my $parser = Pegex::Parser->new(
grammar => VIC::Grammar->new,
receiver => VIC::Receiver->new,
);