Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I'm busy changing my GitHub status

Pierre Krieger tomaka

💭
I'm busy changing my GitHub status
View GitHub Profile
View diff.patch
diff --git a/kernel/standalone/src/mem_alloc.rs b/kernel/standalone/src/mem_alloc.rs
index 83594be..0bb08b7 100644
--- a/kernel/standalone/src/mem_alloc.rs
+++ b/kernel/standalone/src/mem_alloc.rs
@@ -13,7 +13,8 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
-use core::ops::Range;
+use alloc::alloc::{GlobalAlloc, Layout};
View doom.diff
diff --git a/linuxdoom-1.10/Makefile b/linuxdoom-1.10/Makefile
index 8c69794..e9b6459 100644
--- a/linuxdoom-1.10/Makefile
+++ b/linuxdoom-1.10/Makefile
@@ -4,11 +4,11 @@
#
# $Log:$
#
-CC= gcc # gcc or g++
+CC= /home/pierre/Projets/wasi-sdk-8.0/bin/clang # gcc or g++
View doom.diff
diff --git a/linuxdoom-1.10/Makefile b/linuxdoom-1.10/Makefile
index 8c69794..e9b6459 100644
--- a/linuxdoom-1.10/Makefile
+++ b/linuxdoom-1.10/Makefile
@@ -4,11 +4,11 @@
#
# $Log:$
#
-CC= gcc # gcc or g++
+CC= /path/to/wasi-sdk-8.0/bin/clang # gcc or g++
View doom-wasi.diff
diff --git a/linuxdoom-1.10/Makefile b/linuxdoom-1.10/Makefile
index 8c69794..38a1617 100644
--- a/linuxdoom-1.10/Makefile
+++ b/linuxdoom-1.10/Makefile
@@ -4,11 +4,11 @@
#
# $Log:$
#
-CC= gcc # gcc or g++
+CC= /home/pierre/Projets/wasi-sdk-8.0/bin/clang # gcc or g++
View stdweb_future.rs
// Suppose you have a variable named `future` which implements the `Future` trait.
let future: impl Future = ...;
// This gist demonstrates how to run the future until completion using the `stdweb` crate.
// The various imports.
extern crate futures;
extern crate stdweb;
@tomaka
tomaka / srgb.glsl
Created Aug 7, 2017
Non-linear sRGB to linear sRGB
View srgb.glsl
vec3 srgb_to_linear(vec3 c) {
return mix(c / 12.92, pow((c + 0.055) / 1.055, vec3(2.4)), step(0.04045, c));
}
@tomaka
tomaka / gist:61807c08693604c25fc9a585220f46cc
Last active Oct 12, 2017
Creating a tasks system based on Rust coroutines
View gist:61807c08693604c25fc9a585220f46cc

Let's take the first example from the Rust generators RFC:

#[async]
fn print_lines() -> io::Result<()> {
    let addr = "127.0.0.1:8080".parse().unwrap();
    let tcp = await!(TcpStream::connect(&addr))?;
    ...
}
View tree.rs
use std::cmp;
use cgmath::Vector2;
/// Tree that subdivides a 2D area.
#[derive(Debug, Clone)]
pub struct Tree {
// Dimensions of the root.
root_dimensions: Vector2<u32>,
// Binary tree of the space partition within the texture. The first element represents the area
View f.rs
unsafe impl<'a, Cb, V, Pv, Pl, Prp, S, Pc, O, O1, O2, O3, O4, O5> AddCommand<CmdDraw<V, Pv, Pl, Prp, S, Pc>> for Cb
where Pl: PipelineLayoutRef,
S: DescriptorSetsCollection,
Cb: AddCommand<CmdBindVertexBuffers<V>, Out = O1>,
O1: AddCommand<CmdPushConstants<Pc, Arc<GraphicsPipeline<Pv, Pl, Prp>>>, Out = O2>,
O2: AddCommand<CmdBindDescriptorSets<S, Arc<GraphicsPipeline<Pv, Pl, Prp>>>, Out = O3>,
O3: AddCommand<CmdSetState, Out = O4>,
O4: AddCommand<CmdBindPipeline<Arc<GraphicsPipeline<Pv, Pl, Prp>>>, Out = O5>,
O5: AddCommand<CmdDrawRaw, Out = O>
{
View gist:0b5c6a352b9c879d443a51ba3b863bb5
[build]
rustflags = ["-Ctarget-cpu=native", "-Ctarget-feature=+crt-static", "-Zunstable-options"]