Skip to content

Instantly share code, notes, and snippets.

View AregevDev's full-sized avatar
🎯
Focusing

AregevDev

🎯
Focusing
View GitHub Profile
use glium::glutin::{
dpi::LogicalSize, Api, ContextBuilder, Event, EventsLoop, GlRequest, WindowBuilder, WindowEvent,
};
use glium::index::{NoIndices, PrimitiveType};
use glium::texture::RawImage2d;
use glium::{implement_vertex, uniform, Display, DrawParameters, Program, Surface, VertexBuffer};
use image::GenericImageView;
use std::io::Cursor;
use glium::uniforms::{Sampler, MagnifySamplerFilter};
@AregevDev
AregevDev / serenity.rs
Created April 25, 2019 10:26
Discord bot in Rust WIP
use serenity::model::prelude::{Channel, UserId};
use serenity::utils::Colour;
use serenity::{
framework::{
standard::macros::{check, command, group, help},
standard::{
help_commands, Args, CheckResult, CommandGroup, CommandOptions, CommandResult,
HelpOptions,
},
StandardFramework,
@AregevDev
AregevDev / Main.cr
Created April 9, 2019 11:19
raylib-cr
@[Link(ldflags: "-L#{__DIR__} -lraylib -lglfw3 -lX11 -lm")]
lib LibRaylib
struct Color
r : UInt8
g : UInt8
b : UInt8
a : UInt8
end
fun InitWindow(width : Int32, height : Int32, title : LibC::Char*) : Void
@AregevDev
AregevDev / order66.rs
Last active February 22, 2019 19:12
A Rust simulation of Star Wars III's order 66 scene
use std::fmt::{Display, Formatter, Result};
use std::sync::{Arc, Mutex};
enum Killer {
AnakinSkywalker,
Clones,
}
impl Display for Killer {
fn fmt(&self, f: &mut Formatter) -> Result {
@AregevDev
AregevDev / lambdas.kt
Last active July 17, 2018 14:50
A cheatsheet about the stdlib lambdas in Kotlin
fun main(args: Array<String>) {
val str = "I am a string"
str.run {
// no lambda params, receiver is value type (String), returns R, the result of the lambda.
}
str.let {
// lambda params are value type (String), no receiver, returns R, the result of the lambda.
}