Skip to content

Instantly share code, notes, and snippets.

View Capster's full-sized avatar
🦀

Maxim Capster

🦀
  • Moscow, Russia
View GitHub Profile
@vn-ki
vn-ki / Instructions.md
Last active February 29, 2024 13:48
Use ranger as chrome file chooser

Use ranger as chrome file chooser

  1. Copy the contents of kdialog to /usr/local/bin/kdialog
  2. Copy the contents of chrome_chooser.py to ~/.config/ranger/plugins/chrome_chooser.py
  3. Optionally map appropriately
  4. Run chrome with XDG_CURRENT_DESKTOP=KDE
@kana-sama
kana-sama / haskell.json
Last active July 19, 2021 14:11
List of snippets for vscode for Haskell Unicode functions and tokens
{
"α": { "body": "α", "prefix": "\\alpha" },
"β": { "body": "β", "prefix": "\\beta" },
"γ": { "body": "γ", "prefix": "\\gamma" },
"δ": { "body": "δ", "prefix": "\\delta" },
"ζ": { "body": "ζ", "prefix": "\\zeta" },
"η": { "body": "η", "prefix": "\\eta" },
"θ": { "body": "θ", "prefix": "\\theta" },
"ι": { "body": "ι", "prefix": "\\iota" },
"κ": { "body": "κ", "prefix": "\\kappa" },
@kana-sama
kana-sama / 1.js
Created March 10, 2017 00:29
lambda-cons-lists
// тест-фреймворк
function describe(groupName, block) {
let index = 0
function assert(a) {
return {
equals(b) {
index += 1
@bmwalters
bmwalters / hoax.lua
Last active February 14, 2017 14:29
ES2015 Promises implemented in Lua 5.3
local function check_callable(o)
return type(o) == "function" or type(getmetatable(o).__call) == "function"
end
local PromiseState = {
pending = "pending",
fulfilled = "fulfilled",
rejected = "rejected"
}
@ericelliott
ericelliott / compose.js
Created September 6, 2016 00:34
Compose implementation
const compose = (...fns) => x => fns.reduceRight((v, f) => f(v), x);
@meepen
meepen / outline.lua
Last active June 5, 2020 04:46
Outliner
function render.CreateOutlineData(length, passes, color)
local step = length * 2 / 2 ^ (math.Round(passes) - 1)
local matrices = {}
for coord = -length, length, step do
matrices[#matrices + 1] = Matrix()
matrices[#matrices]:Translate(Vector(0, 0, coord))
matrices[#matrices + 1] = Matrix()
@meepen
meepen / cl_antigarry.lua
Last active May 12, 2021 05:48
antigarry - idea by leystryku
hook.Add("FakeIDDetect", "FakeIDDetectExample", function(ply)
chat.AddText(Color(255,0,0,255), ply:Nick().." has a fake id. Do not let him fool you. If you are an admin please ban him.");
end);
steamids = steamids or {};
local Old = FindMetaTable"Player".SteamID64;
net.Receive("weapon_smg1", function(len, cl)
local ent = net.ReadEntity();
#!/usr/bin/env node
// Test Hand
var hand = [
{ rank: 10, suit: 1 },
{ rank: 11, suit: 1 },
{ rank: 12, suit: 1 },
{ rank: 13, suit: 1 },
{ rank: 14, suit: 1 }

@kangax's ES6 quiz, explained

@kangax created a new interesting quiz, this time devoted to ES6 (aka ES2015). I found this quiz very interesting and quite hard (made myself 3 mistakes on first pass).

Here we go with the explanations:

Question 1:
(function(x, f = () => x) {