Skip to content

Instantly share code, notes, and snippets.

View and3rson's full-sized avatar
♥️
Time You Enjoy Wasting Is Not Wasted Time.

Andrew Dunai and3rson

♥️
Time You Enjoy Wasting Is Not Wasted Time.
View GitHub Profile
[START][2021-11-13 01:54:50] LSP logging initiated
[INFO][2021-11-13 01:54:52] .../vim/lsp/rpc.lua:258 "Starting RPC client" { args = {}, cmd = "pylsp", extra = {}}
[DEBUG][2021-11-13 01:54:52] .../vim/lsp/rpc.lua:339 "rpc.send" { id = 1, jsonrpc = "2.0", method = "initialize", params = { capabilities = { callHierarchy = { dynamicRegistration = false }, textDocument = { codeAction = { codeActionLiteralSupport = { codeActionKind = { valueSet = { "", "Empty", "QuickFix", "Refactor", "RefactorExtract", "RefactorInline", "RefactorRewrite", "Source", "SourceOrganizeImports", "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite", "source", "source.organizeImports" } } }, dataSupport = true, dynamicRegistration = false, resolveSupport = { properties = { "edit" } } }, completion = { completionItem = { commitCharactersSu
[START][2021-11-13 01:54:50] LSP logging initiated
[INFO][2021-11-13 01:54:52] .../vim/lsp/rpc.lua:258 "Starting RPC client" { args = {}, cmd = "pylsp", extra = {}}
[DEBUG][2021-11-13 01:54:52] .../vim/lsp/rpc.lua:339 "rpc.send" { id = 1, jsonrpc = "2.0", method = "initialize", params = { capabilities = { callHierarchy = { dynamicRegistration = false }, textDocument = { codeAction = { codeActionLiteralSupport = { codeActionKind = { valueSet = { "", "Empty", "QuickFix", "Refactor", "RefactorExtract", "RefactorInline", "RefactorRewrite", "Source", "SourceOrganizeImports", "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite", "source", "source.organizeImports" } } }, dataSupport = true, dynamicRegistration = false, resolveSupport = { properties = { "edit" } } }, completion = { completionItem = { commitCharactersSu
@and3rson
and3rson / domain_models_with_repositories.py
Last active May 23, 2019 18:38
Domain models with repositories
# pylint: disable=too-few-public-methods,missing-docstring,no-self-use
# pylint: disable=invalid-name,fixme,unused-variable
from typing import List
from unittest.mock import Mock
# Simulate Django models
models = Mock()
models.Loan.objects.get.return_value = Mock()
models.Loan.objects.filter().__iter__ = Mock(side_effect=lambda: iter([Mock(), Mock()]))
models.Document.objects.get.return_value = Mock()
@and3rson
and3rson / physbones.gd
Created January 21, 2019 00:58
Simple ragdoll physical bones creation plugin for Godot
tool
extends EditorPlugin
var button : Button
func _enter_tree():
print('physbones: plugin created')
button = Button.new()
button.text = 'CPB'
button.connect('pressed', self, 'create_physical_bones')
var getParamElements = () => Array.prototype.slice.call(document.querySelectorAll('.parameters div[name="parameter"]'));
var populateArgs = () => {
if (getParamElements().length) {
var match,
pl = /\+/g, // Regex for replacing addition symbol with a space
search = /([^&=]+)=?([^&]*)/g,
decode = function (s) { return decodeURIComponent(s.replace(pl, " ")); },
query = window.location.search.substring(1);
@and3rson
and3rson / steamapi_test.py
Last active October 25, 2018 20:09
Using `libsteam_api.so` from Python via `ctypes.CDLL`
#!/usr/bin/env python3
# Hint: use steam_api_interop.cs for function signatures.
# Luckily libsteam_api.so has all of the methods demangled out of the box.
import ctypes
# Specify path to libsteam_api.so here
so = ctypes.CDLL('../sdk/redistributable_bin/linux64/libsteam_api.so')

Keybase proof

I hereby claim:

  • I am and3rson on github.
  • I am and3rson (https://keybase.io/and3rson) on keybase.
  • I have a public key ASDGNY1514cM8ymw7beCUh2GAZXNo3iDcdTygF27gkt66wo

To claim this, I am signing this object:

@and3rson
and3rson / keymap.c
Created March 20, 2018 10:08
My Preonic keymap
/* Copyright 2015-2017 Jack Humbert
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@and3rson
and3rson / zhack.js
Last active November 13, 2017 08:56
Hack for zty.pe
const getWords = () => Object.keys(ig.game.targets).map(
key => (ig.game.targets.hasOwnProperty(key) && ig.game.targets[key].length && ig.game.targets[key][0].health) ? ig.game.targets[key][0].word : null
).filter(x => x);
const delayed = (fn) => new Promise((resolve, reject) => {
setTimeout(() => {
fn();
resolve();
}, 33);
});
@and3rson
and3rson / installation.md
Created March 3, 2017 16:06
Brutal Doom