Skip to content

Instantly share code, notes, and snippets.

View ingydotnet's full-sized avatar

Ingy döt Net ingydotnet

View GitHub Profile
@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 / 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 / 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 / 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
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: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
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
reviewed:
- dan:
review_title:
review_description:
review_count:
reviewer_name:
reviewr_city:
- mark:
review_title:
review_description:
@ingydotnet
ingydotnet / test.bash
Last active August 29, 2015 14:02 — forked from AndrewSmart/gist:1796bc4fffc4e46e8150
Refactored to this script
#!/usr/bin/env bash
set -ex
rm -fr p1 p2 lib lib.git
(
mkdir lib p1 p2
git init --bare lib
git init p1
git init p2
Code: sub foo { ... } xyz