This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
This example bot is structured in multiple files and is made with the goal of showcasing commands, events and cogs. | |
Although this example is not intended as a complete bot, but as a reference aimed to give you a basic understanding for | |
creating your bot, feel free to use these examples and point out any issue. | |
+ These examples are made with educational purpose and there are plenty of docstrings and explanation about most of the code. | |
+ This example is made with Python 3.8.5 and Discord.py 1.4.0a (rewrite). | |
Documentation: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# NOTE: This script exports only one uid | |
key_pattern= | |
remote_host= | |
remote_path=/var/www/html/.well-known/openpgpkey/hu/ | |
for item in $(gpg --list-secret-keys --with-colons ${key_pattern:- } \ | |
| awk -F: '($1 == "sec" && $2 == "u") { print $5}'); do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define invoke(inst, meth, ...) (inst)->meth((inst), __VA_ARGS__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cctype> | |
#include <cstdint> | |
#include <fstream> | |
#include <iostream> | |
#include <locale> | |
#include <algorithm> | |
int main(int argc, char **argv) | |
{ | |
std::locale::global(std::locale("")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -xe | |
gcc -o main main.c -lSDL2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub struct SVG { | |
text: String, | |
height: usize, | |
width: usize, | |
} | |
const INDENT: &str = " "; | |
const XMLNS: &str = "http://www.w3.org/2000/svg"; | |
const XLINK: &str = "http://www.w3.org/1999/xlink"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::thread::sleep; | |
use std::time::{Duration, SystemTime, UNIX_EPOCH}; | |
#[derive(Debug, Copy, Clone)] | |
enum Cell { | |
Dead = 0, | |
Live = 1, | |
} | |
impl Cell { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::thread::sleep; | |
use std::time::Duration; | |
// Add rand in the dependencies section of Cargo.toml | |
use rand::Rng; | |
#[derive(Debug, Copy, Clone)] | |
enum Cell { | |
Dead = 0, | |
Live = 1, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef MEMSWAP_H | |
#define MEMSWAP_H | |
static inline void | |
memswap(void *restrict aptr, void *restrict bptr, size_t len) | |
{ | |
register unsigned char *a = aptr; | |
register unsigned char *b = bptr; | |
register unsigned char t; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Uncomment -DDYN_PROCS if dynamic loading of OpenGL function is preferable over static linking | |
CFLAGS=-O2 -Wall -Wextra #-DDYN_PROCS | |
LDFLAGS=-lglfw -lGL | |
gradient: gradient.o | |
$(CC) -o $@ $(CFLAGS) $(LDFLAGS) $^ | |
%.o: %.c | |
$(CC) -o $@ -c $(CFLAGS) $^ |
NewerOlder