Skip to content

Instantly share code, notes, and snippets.

View yrashk's full-sized avatar
🎯
Being productive

Yurii Rashkovskii yrashk

🎯
Being productive
View GitHub Profile
@yrashk
yrashk / SCM_RIGHTS.md
Created March 3, 2023 14:19 — forked from kentonv/SCM_RIGHTS.md
SCM_RIGHTS API quirks

As tested on Linux:

  • An SCM_RIGHTS ancillary message is "attached" to the range of data bytes sent in the same sendmsg() call.
  • However, as always, recvmsg() calls on the receiving end don't necessarily map 1:1 to sendmsg() calls. Messages can be coalesced or split.
  • The recvmsg() call that receives the first byte of the ancillary message's byte range also receives the ancillary message itself.
  • To prevent multiple ancillary messages being delivered
@yrashk
yrashk / api.cpp
Created March 3, 2023 14:18 — forked from RikkaW/api.cpp
Socket send fd
void api::OpenFiles(RiruFile *files, size_t count) {
struct sockaddr_un addr{};
int fd;
socklen_t socklen;
uint8_t *data;
uint32_t data_size;
int32_t reply[count];
uint32_t reply_size;
std::vector<int> fds;
@yrashk
yrashk / gist:bc9e2d3a0c6c0c33bebc18113eb3b282
Created April 3, 2016 16:46 — forked from knu/gist:111055
How to mass-rename tags and push them with Git
# Rename tags named foo-bar-#.#.# to v#.#.# and push the tag changes
git tag -l | while read t; do n="v${t##*-}"; git tag $n $t; git push --tags ; git tag -d $t; git push origin :refs/tags/$t ; done
@yrashk
yrashk / leven.ex
Created November 28, 2012 20:58 — forked from plukevdh/leven.ex
Levenshtein in elixir
defmodule Levenshtein do
def first_letter_check(one_letter, two_letter) do
case one_letter == two_letter do
true -> 0
false -> 1
end
end
def distance(string_1, string_1), do: 0
def distance(string, ''), do: :string.len(string)
@yrashk
yrashk / leven.ex
Created November 28, 2012 20:44 — forked from plukevdh/leven.ex
Levenshtein in elixir
defmodule Levenshtein do
def first_letter_check(one_letter, two_letter) do
case one_letter == two_letter do
true -> 0
false -> 1
end
end
def distance(string_1, string_1), do: 0
def distance(string, ''), do: :string.len(string)
@yrashk
yrashk / tmux-p0wn.sh
Created October 1, 2012 18:28 — forked from djui/tmux-p0wn.sh
p0wn your tmux session
alias tmux-p0wn='tmux list-clients | sed "s|^\(/dev/ttys[0-9]\+\).*\[\([0-9]\+x[0-9]\+\).*$|\2 \1|" | sort -r -n | tail -n +2 | cut -d " " -f 2 | xargs -n 1 tmux detach-client -t'
@yrashk
yrashk / about.md
Created August 9, 2011 21:20 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer
diff --git a/c_src/erlv8.cc b/c_src/erlv8.cc
index e984844..84b0144 100644
--- a/c_src/erlv8.cc
+++ b/c_src/erlv8.cc
@@ -23,6 +23,7 @@ static ErlV8TickHandler tick_handlers[] =
{"set", SetTickHandler},
{"set_proto", SetProtoTickHandler},
{"set_hidden", SetHiddenTickHandler},
+ {"set_accessor", SetAccessorTickHandler},
{"proplist", ProplistTickHandler},
diff --git a/c_src/erlv8.cc b/c_src/erlv8.cc
index e984844..84b0144 100644
--- a/c_src/erlv8.cc
+++ b/c_src/erlv8.cc
@@ -23,6 +23,7 @@ static ErlV8TickHandler tick_handlers[] =
{"set", SetTickHandler},
{"set_proto", SetProtoTickHandler},
{"set_hidden", SetHiddenTickHandler},
+ {"set_accessor", SetAccessorTickHandler},
{"proplist", ProplistTickHandler},
@yrashk
yrashk / PACKAGES.txt
Created February 14, 2011 11:26 — forked from nox/PACKAGES.txt
NGerlguten https://github.com/CarlWright/NGerlguten
RefactorErl http://plc.inf.elte.hu/erlang/
anal http://forum.trapexit.org/viewtopic.php?t=9279
assoc http://forum.trapexit.org/viewtopic.php?t=150
bloomerl http://code.google.com/p/bloomerl/
crone http://catseye.tc/projects/crone/
dbus http://code.google.com/p/erlang-dbus/
depcheck http://forum.trapexit.org/viewtopic.php?t=9283
diff http://forum.trapexit.org/viewtopic.php?t=9285
edep jungerl