Skip to content

Instantly share code, notes, and snippets.

View Paegasus's full-sized avatar

Lahcéne Belbachir Paegasus

  • Alicante, Spain
View GitHub Profile
@acidleaf
acidleaf / vec2.h
Last active June 28, 2024 07:40
C++ 2D Vector
/*
Copyright (c) 2020 Chan Jer Shyan
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@DmitrySoshnikov
DmitrySoshnikov / dfs-bfs-non-recursive.js
Created October 19, 2015 05:40
Non-recursive DFS and BFS algorithms
/**
* Depth-first and Breadth-first graph traversals.
*
* In this diff we implement non-recursive algorithms for DFS,
* and BFS maintaining an explicit stack and a queue.
*
* by Dmitry Soshnikov <dmitry.soshnikov@gmail.com>
* MIT Style license
*/
@cmdr2
cmdr2 / GenerateMesh02.cs
Last active November 1, 2023 14:28
A mesh extrusion along a bezier curve (Unity3d)
[RequireComponent(typeof(MeshFilter))]
public class GenerateMesh02 : MonoBehaviour {
/* scratchpad */
private MeshFilter mf;
void Start () {
mf = GetComponent<MeshFilter> ();
GenerateMesh ();
@mochja
mochja / main.c
Last active September 25, 2023 15:08
Yoga + OpenGL Example
#include <GLFW/glfw3.h>
#include <yoga/Yoga.h>
#include <stdlib.h>
int main(void)
{
GLFWwindow* window;
/* Initialize the library */
if (!glfwInit())
@leonardfischer
leonardfischer / index.html
Last active December 16, 2021 22:27
Creating a zoom- and panable tile-grid in D3 (via SVG patterns)
<svg>
<defs>
<pattern id="inner-grid" width="10" height="10" patternUnits="userSpaceOnUse">
<rect width="100%" height="100%" fill="none" stroke="#ccc" stroke-width="0.5" />
</pattern>
<pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse">
<rect width="100%" height="100%" fill="url(#inner-grid)" stroke="#ccc" stroke-width="1.5" />
</pattern>
</defs>
<rect x="0" y="0" width="100%" height="100%" fill="url(#grid)"></rect>