Skip to content

Instantly share code, notes, and snippets.

View nulldef's full-sized avatar
:electron:

Aleksei Bespalov nulldef

:electron:
View GitHub Profile
@nulldef
nulldef / sidekiq_extension.rb
Created October 16, 2023 13:44
Run sidekiq job only after commit
module SidekiqClientExtension
def raw_push(jobs)
DB.after_commit { super }
end
end
Sidekiq::Client.prepend(SidekiqClientExtension)
@nulldef
nulldef / config.cfg
Last active July 4, 2023 13:05
CSGO config
cfgver "1"
unbindall
bind "1" "slot1"
bind "2" "slot2"
bind "3" "slot3"
bind "4" "slot4"
bind "5" "slot5"
bind "6" "slot6"
bind "9" "slot9"
bind "a" "+moveleft;r_cleardecals"
@nulldef
nulldef / J.js
Created October 30, 2019 09:59
Promise-like JS microlib
const PENDING = -1
const SUCCESS = 0
const ERROR = 1
class J {
constructor (fn) {
this.value = null
this.state = PENDING
this.successReactions = []
this.failureReactions = []
@nulldef
nulldef / delete_opened_file.py
Created June 10, 2019 07:38
Delete opened files sublime plugin
import sublime
import sublime_plugin
import os
class DeleteOpenedFileCommand(sublime_plugin.TextCommand):
def run(self, edit):
file_path = self.view.file_name()
ok = sublime.ok_cancel_dialog("Really remove?", "Yeah, baby!")
if ok:
self.view.close()