Skip to content

Instantly share code, notes, and snippets.

" Called with a command and a redirection target
" (see `:help redir` for info on redirection targets)
" Note that since this is executed in function context,
" in order to target a global variable for redirection you must prefix it with `g:`.
" EG call Redir('ls', '=>g:buffer_list')
funct! Redir(command, to)
exec 'redir '.a:to
exec a:command
redir END
endfunct
@just-sultanov
just-sultanov / bb.edn
Last active January 8, 2022 18:18
Typical project tasks using babashka
{:min-bb-version "0.6.1"
:tasks
{:requires ([babashka.fs :as fs]
[babashka.process :as proc]
[clojure.string :as str]
[clojure.pprint :as pprint])
;; Helpers
@didibus
didibus / user.clj
Created January 29, 2020 04:20
A Clojure user.clj file which lets you lazy load certain namespace at the REPL
(def safe-requires
"List of namespaces to require and refer when inside user ns at load time.
Can be given an initialization body to execute after having been required.
To do so, wrap the lib spec in a vector, and all elements after the lib
spec vector will be evaled after the lib spec has been required."
'[[clojure.repl :as repl :refer (source apropos dir pst doc find-doc)]
[clojure.java.javadoc :as javadoc :refer (javadoc)]
[clojure.pprint :as pprint :refer (pp pprint)]
[clojure.stacktrace :as stacktrace :refer (e)]
@hjr3
hjr3 / rust-naming-conventions.md
Created October 20, 2016 14:28
Rust Naming Conventions
Convention Example General Meaning
to_*() str::to_string() A conversion from one type to another that may have an allocation or computation cost. Usually a Borrowed type to Owned type.
as_*() String::as_str() Convert an Owned type into a Borrowed type. It is usually cheap (maybe even zero-cost) to use this function.
into_*() String::into_bytes() Consume a type T and convert it into an Owned type U.
from_*() SocketAddr::from_str() Create an Owned type from an Owned or Borrowed type.
*_mut() str::split_at_mut() Denotes a mutable reference.
try_*() usize::try_from() Method will return a Result or Option type. Usually Result.
with_*() Vec::with_capacity() A constructor that has one or more parameters used to configure the type.
@rjw57
rjw57 / CGSPrivate.h
Last active December 2, 2022 06:36
CGSPrivate.h - undocumented APIs for OSX. Re-licensed under MIT licence.
/* CGSPrivate.h -- Header file for undocumented CoreGraphics stuff. */
/* This file is a relicensed portion of DesktopManager and was originally released under
* the terms of the GNU General Public Licence. Original licence text follows the new terms.
* The contents of this file has been re-released by the original author under the following terms:
*
* Copyright (C) 2003, 2004, 2013 Richard J Wareham <richwareham@users.sourceforge.net>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the Software
@AndrewJakubowicz
AndrewJakubowicz / Cargo.toml
Last active December 20, 2022 15:05
Specs Roguelike
[package]
name = "specs-roguelike"
version = "0.1.0"
authors = ["youCodeThings"]
edition = "2018"
[dependencies]
tcod = "0.13"
specs = "0.14.0"
@abcdefg30
abcdefg30 / installation.md
Last active September 15, 2023 08:47
Unofficial, manual content installation for OpenRA

Manual (unrecommended) installation of the required content files for OpenRA

⚠️ This method is not recommended and should only be applied if automatic installation fails. Success of manually installing the files can not be guaranteed. ⚠️

⚠️ The automatic installation may fail for non-english content. OpenRA does not support other languages at the current stage of development and no such content should be installed. ⚠️

⚠️ Manually installing files can corrupt your game and lead to crashes. ⚠️

If you have trouble with automatic installation, please contact the developers (via IRC, our forum, the webpage comments or our issue tracker) before attempting a manual install.

@MostAwesomeDude
MostAwesomeDude / brismu.md
Last active January 22, 2024 19:24
The relational interpretation of Lojban (la brismu)

0: Introduction

This pamphlet is addressed at folks who know Lojban. They've read not just a tutorial like la karda, the Crash Course, or the Wave Lessons, but also CLL and the BPFK Sections, and some of the various notes from many community members.

I am not aiming to teach the syntax of Lojban, but to radically and fundamentally approach the logical foundations of the semantics of Lojban. We will not start with pronouns, but with relations, and we will always keep the mathematics in mind as we progress.

A common theme in the Lojban community is an uncertainty about what words mean. Since words are treacherous and don't have ultimate meaning, and many Lojbanists are philosophers, it is predictably common for such uncer

@jagrosh
jagrosh / Growing A Discord Server.md
Last active February 17, 2024 04:29
Tips for creating and growing a new Discord server

This guide is kept up-to-date as Discord and available resources change!
A basic server template is available here

Creating and Growing a Discord Server

logo

Introduction

Hello! I'm jagrosh#4824! I'm writing this guide to try to help new server owners set up and grow their servers, which is a commonly-requested topic. It's very easy to go about this the wrong way, so it's best to be prepared and make smart decisions so that your community can flourish!

Background

@johndrinkwater
johndrinkwater / dualshock-research
Last active March 16, 2024 15:12
I’m interested in writing (or helping to spec out the protocol so someone else can write) the linux kernel driver for Sony’s DualShock 4 (PS4’s lovely controller) Currently using the output of HID RAW from a USB connected dualshock 4… For the gyro/touchpad discovery, I’ve just been using some terrible c code to throw numbers on the screen and it…
TADA, it’s `hexdump -v -e '64/1 "%02x" "\n"' < /dev/hidraw3`
No idea what the first byte is… but I’m going to assume its for device ID for the many users that are connected, but it probably has to be set by the connected machine?
01ff777f7f0800aa0000435dfdf1ff14000200c5ff0721150300000000001b000001fc9133a32990880428008000000080000000008000000080000000008000
↑↑↑↑
left stick, value, first field is horz (00 left), second field is vertical (00 top)
017f80ff61080064000059f2fdfffffbff0e00d107081e9bf600000000001b0000018e94b1b00690880428008000000080000000008000000080000000008000
↑↑↑↑