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
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. | |
} |
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::fmt::{Display, Formatter, Result}; | |
use std::sync::{Arc, Mutex}; | |
enum Killer { | |
AnakinSkywalker, | |
Clones, | |
} | |
impl Display for Killer { | |
fn fmt(&self, f: &mut Formatter) -> Result { |
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
@[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 |
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 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, |
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 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}; |
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 oauth2::reqwest::http_client; | |
use oauth2::{basic::BasicClient, AuthUrl, AuthorizationCode, ClientId, ClientSecret, CsrfToken, Scope, TokenUrl, TokenResponse}; | |
use std::io::{BufRead, BufReader, Write}; | |
use std::net::TcpListener; | |
use url::Url; | |
use serenity::http::Http; | |
fn main() { | |
let client = BasicClient::new( | |
ClientId::new("544523578855391241".to_string()), |
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
char *readFile(const char *filepath) { | |
char *source = NULL; | |
FILE *fp = fopen(filepath, "r"); | |
if (fp) { | |
if (fseek(fp, 0L, SEEK_END) == 0) { | |
long bufsize = ftell(fp); | |
source = malloc(sizeof(char) * (bufsize + 1)); | |
fseek(fp, 0L, SEEK_SET); | |
size_t len = fread(source, sizeof(char), bufsize, fp); |
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 <math.h> | |
#include <raylib/raymath.h> | |
#include <raylib/raylib.h> | |
int main() { | |
InitWindow(500, 500, "Hello World"); | |
SetTargetFPS(60); | |
Vector2 player = {30.0f, 70.0f}; |
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 GLFW_INCLUDE_NONE | |
#include <GLFW/glfw3.h> | |
#include <glad/glad.h> | |
#define STB_IMAGE_IMPLEMENTATION | |
#include <stb/stb_image.h> | |
#define NK_INCLUDE_FIXED_TYPES |
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
// | |
// Created by AregevDev on 11/5/2019. | |
// | |
#pragma once | |
#include <glad/glad.h> | |
#include <sstream> | |
#include <fstream> |
OlderNewer