Skip to content

Instantly share code, notes, and snippets.

@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

@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.
@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
#pragma once
#include <memory>
#include <iostream>
#include <string>
#include <cstdio>
using namespace std;
/// Cast an FString to char * for debugging purposes
@cwensley
cwensley / StackLayoutTest.cs
Created February 17, 2015 17:27
Shows the new StackLayout
public class MyForm : Form
{
public MyForm()
{
ClientSize = new Size(200, 200);
Content = new StackLayout
{
Orientation = Orientation.Vertical,
ContentAlign = StackLayoutAlign.Center,
Spacing = 10,
@cwensley
cwensley / pal-edit.cs
Last active August 29, 2015 14:14 — forked from phrohdoh/pal-edit.cs
using System;
using System.Collections.Generic;
using Eto;
using Eto.Forms;
using Eto.Drawing;
namespace ShpSharp
{
public class PalEditorForm : Form
{
@demisx
demisx / syntax.css
Last active February 20, 2020 04:32
Syntax highlighter CSS file
.highlight { background: #ffffff; }
.highlight .c { color: #999988; font-style: italic } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { font-weight: bold } /* Keyword */
.highlight .o { font-weight: bold } /* Operator */
.highlight .cm { color: #999988; font-style: italic } /* Comment.Multiline */
.highlight .cp { color: #999999; font-weight: bold } /* Comment.Preproc */
.highlight .c1 { color: #999988; font-style: italic } /* Comment.Single */
.highlight .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
@jgold6
jgold6 / XamarinUninstall
Created July 24, 2014 22:31
Xamarin Nuclear Uninstall Bash Script - Mac OS X
#!/bin/bash
sudo launchctl unload /Library/LaunchAgents/com.xamarin.mtvs.buildserver.plist
sudo rm -f /Library/LaunchAgents/com.xamarin.mtvs.buildserver.plist
sudo rm -rf /Developer/MonoTouch
sudo rm -rf /Developer/MonoAndroid
sudo rm -rf /Library/Frameworks/Mono.framework
sudo rm -rf /Library/Frameworks/Xamarin.Android.framework
sudo rm -rf /Applications/Xamarin Studio.app
sudo rm -rf ~/Library/Developer/Xamarin
@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
↑↑↑↑
@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