Skip to content

Instantly share code, notes, and snippets.

View Emilgardis's full-sized avatar

Emil Gardström Emilgardis

  • Sweden
  • 19:02 (UTC +01:00)
View GitHub Profile
[package]
name = "twitch_tokens"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
reqwest = "0.11.16"
tokio = { version = "1.27.0", features = ["macros", "rt-multi-thread"] }
@Emilgardis
Emilgardis / settings.json
Last active March 11, 2023 19:20
r-a postfix
{
"rust-analyzer.completion.snippets.custom": {
"Arc::new": {
"postfix": "arc",
"body": "Arc::new(${receiver})",
"requires": "std::sync::Arc",
"description": "Put the expression into an `Arc`",
"scope": "expr"
},
"Rc::new": {
@Emilgardis
Emilgardis / lib.rs
Created December 29, 2022 00:33
defer
fn defer<F: FnOnce()>(f: F) -> impl Drop {
struct D<F: FnOnce()>(Option<F>);
impl<F: FnOnce()> Drop for D<F> {
fn drop(&mut self) {
if let Some(f) = self.0.take() {
f()
}
}
}
D(Some(f))
@Emilgardis
Emilgardis / main.rs
Created September 16, 2021 19:28
Cargo build hangs minimized, 88862
#[derive(Debug)]
struct Error;
struct SharedPool {
a: PoolOptions,
}
struct PoolOptions;
async fn check<'s: 'p, 'p>(
mut _conn: Floating<'s>,
@Emilgardis
Emilgardis / Cargo.toml
Created September 14, 2021 00:48
Cargo build hangs - minimized, a bit more rust-lang/rust#88862
[package]
name = "maybe"
version = "0.1.0"
edition = "2018"
resolver = "2"
[dependencies]
sqlx = { version = "0.5.7", default-features = false, features = [
"runtime-tokio-native-tls",
@Emilgardis
Emilgardis / Cargo.toml
Last active September 13, 2021 21:49
Cargo build hangs - minimized, but not really rust-lang/rust#88862
[package]
name = "maybe"
version = "0.1.0"
edition = "2018"
resolver = "2"
[dependencies]
sqlx = { version = "0.5.7", default-features = false, features = [
"runtime-tokio-native-tls",
// ==UserScript==
// @name clone_github_on_vscode
// @namespace http://greasespot.net/
// @version 0.2
// @description Let you open Github repositories in vscode
// @author idanp, emilgardis
// @match https://github.com/*
// @grant none
// ==/UserScript==
1
00:00:00,000 --> 00:00:03,416
KODJO: At 9, since this last segment got a bit of the rails, we have of course a guest
2
00:00:03,416 --> 00:00:08,875
and that is Anniefuchsia who is super big on twitch and we are going to learn all about it
3
00:00:11,291 --> 00:00:15,125
@Emilgardis
Emilgardis / gist:d88ad1b0ff3d4c8bb7b021d1ae4bcb29
Last active January 22, 2018 10:10
Advanced Scene Switcher OBS crash
Unhandled exception: c0000005
Date/Time: 2018-01-22, 10:45:23
Fault address: 7FF88103F497 (d:\program files (x86)\obs-studio\obs-plugins\64bit\advanced-scene-switcher.dll)
libobs version: 20.1.3
Windows version: 10.0 build 15063 (revision: 850; 64-bit)
CPU: Intel(R) Core(TM) i5-4690K CPU @ 3.50GHz
Thread 1854 (Crashed)
Stack EIP Arg0 Arg1 Arg2 Arg3 Address
extern crate cortex_m;
extern crate cortex_m_rt;
#[macro_use]
extern crate cortex_m_rtfm;
extern crate pac; // Our peripheral access crate
use rtfm::{C1, P0, P1, Resource, T0, T1, TMax};
peripherals! {
GPIOA: Peripheral {