Skip to content

Instantly share code, notes, and snippets.

View patrickodacre's full-sized avatar

Patrick O'Dacre patrickodacre

View GitHub Profile
// Documentation at https://www.sublimetext.com/docs/color_schemes.html
{
"variables":
{
"text": "#d1b897",
"bg" : "#062329",
},
"globals":
{
"background" : "var(bg)",
@patrickodacre
patrickodacre / taxonomy.sql
Created March 22, 2023 15:06 — forked from arpitbbhayani/taxonomy.sql
Quickly populate random 5 million + rows in a taxonomy using SQL
# create table topics!
create table topics (
id int primary key auto_increment,
name varchar(256),
parent_id int null,
type smallint not null,
foreign key (parent_id) references topics(id),
index(type)
);
#include "SDL2/SDL.h"
#include "SDL2/SDL_mixer.h"
static const char *MY_COOL_MP3 = "cool_tunes.mp3";
int main(int argc, char **argv) {
int result = 0;
int flags = MIX_INIT_MP3;
if (SDL_Init(SDL_INIT_AUDIO) < 0) {
@patrickodacre
patrickodacre / string-conversion.rs
Created May 8, 2021 01:23 — forked from jimmychu0807/string-conversion.rs
Conversion between String, str, Vec<u8>, Vec<char> in Rust
use std::str;
fn main() {
// -- FROM: vec of chars --
let src1: Vec<char> = vec!['j','{','"','i','m','m','y','"','}'];
// to String
let string1: String = src1.iter().collect::<String>();
// to str
let str1: &str = &src1.iter().collect::<String>();
// to vec of byte

eip: title: ERC20Receiver Interface author: Witek Radomski witek@enjin.io, Patrick O'Dacre patrick@patrickwho.me discussions-to: status: Draft type: Standards Track category Interface or ERC ?? created: 2021-04-28 requires: ERC165, ERC20

@patrickodacre
patrickodacre / server-setup-cheat-sheet.md
Last active April 20, 2018 16:04
A simple cheat sheet for setting up a server.

SSH Keys:

  1. Create a new droplet and use a newly-generated SSH Key for authentication.
// Generate SSH key called "play_key" with the comment of "pwho"
ssh-keygen -o -a 100 -t ed25519 -f play_key -C "pwho"

If you want to set a passphrase (recommended), then do so; otherwise, just press enter twice when prompted for a passphrase.

@patrickodacre
patrickodacre / README.md
Created December 4, 2017 19:19 — forked from hofmannsven/README.md
My simply MySQL Command Line Cheatsheet
@patrickodacre
patrickodacre / cloudSettings
Created January 18, 2017 15:19
Visual Studio Code Sync Settings GIST
{"lastUpload":"2017-01-18T15:19:32.859Z"}
// export iife
export default (() => {
const options = {
name : 'UserList',
data,
methods: {
getUsers
}
}
/*
* https://www.freecodecamp.com/challenges/roman-numeral-converter
* */
/**
* My original solution.
*
* @param {integer} num Number to transform.
* @returns {string} Roman numeral equivalent.
*/