Skip to content

Instantly share code, notes, and snippets.

@mieki256
mieki256 / image2gpl.py
Created December 30, 2015 11:48
インデックスカラー画像のパレット値をGIMP Palette(.gpl)に変換
#!/usr/bin/env python
# -*- mode: python; coding: utf-8 -*-
# Last updated: <2015/12/30 20:23:02 +0900>
"""
dump GIMP Palette (.gpl) format from index color image
by mieki256
License: CC0 / Public Domain
"""
import sys
@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.
@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

@Kerollmops
Kerollmops / Aaa.rs
Last active November 10, 2017 14:30
Little hack to display default values in the doc. (don't forget to `cargo test --doc`)
#[derive(Debug, PartialEq, Eq)]
pub struct Aaa {
pub field1: usize,
pub field2: i32,
}
impl Default for Aaa {
/// ```
/// # use aaa::Aaa;
/// # let a =
@orion-v
orion-v / how-to.md
Last active May 18, 2023 00:16
Delete all messages of an user in a Discord channel or server

Delete discord user message history

This script allow for user specific message deletion from an entire server or a single channel using the browser console. This script uses discord search API and it will only delete messages of a chosen user.

How to use

1. Enable developer mode in discord

Go to user settings > appearance in discord and enable Developer mode.

2. Copy and paste the script to a file so you can change the server and author ids.

3. Replace the server and author ids with your own.

@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.

@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"
@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

@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)]
# typed: true
# frozen_string_literal: true
require('dev')
require('fileutils')
module Dev
module Helpers
class APFSVolume
extend(T::Sig)