Skip to content

Instantly share code, notes, and snippets.

View N3RDIUM's full-sized avatar
🌌
Doing some astronomy

1\13121)11_11\/1 N3RDIUM

🌌
Doing some astronomy
View GitHub Profile
@N3RDIUM
N3RDIUM / demo.py
Created February 18, 2022 15:41
PyOpenGL and GLFW example: adding stuff to VBOs from threads!
# imports
from OpenGL.GL import *
from OpenGL.GLU import *
import glfw
import threading
# initialise glfw
if glfw.init() == glfw.FALSE:
exit()
@N3RDIUM
N3RDIUM / Idea-example.py
Last active November 1, 2021 08:35
PyCraft
# I am just an example for idea files!
"""
Explain the idea here
"""
# an example
def someIdea(arg):
print(arg)
#include "application.h"
#include "utils.h"
#include "mesh.h"
#include "texture.h"
#include "light.h"
#include "volume.h"
#include "fbo.h"
#include "shader.h"
#include "input.h"
#include "animation.h"
@MarcAlx
MarcAlx / notification.py
Last active January 24, 2023 22:04
Send Windows notifications from python3
# -*- coding: utf-8 -*-
# Created by Marc_Alx
#
# pip install winrt
# Documentation here : https://github.com/Microsoft/xlang/tree/master/src/package/pywinrt/projection
# NB Only works with version of Windows that supports 'windows.ui.notifications'
#
# Requirements
# Windows 10, October 2018 Update or later.
# Python for Windows, version 3.7 or later
@siwalikm
siwalikm / aes-256-cbc.js
Last active April 19, 2024 21:03
AES-256-CBC implementation in nodeJS with built-in Crypto library
'use strict';
const crypto = require('crypto');
const ENC_KEY = "bf3c199c2470cb477d907b1e0917c17b"; // set random encryption key
const IV = "5183666c72eec9e4"; // set random initialisation vector
// ENC_KEY and IV can be generated as crypto.randomBytes(32).toString('hex');
const phrase = "who let the dogs out";
var encrypt = ((val) => {
@eevee
eevee / perlin.py
Last active March 2, 2024 08:48
Perlin noise in Python
"""Perlin noise implementation."""
# Licensed under ISC
from itertools import product
import math
import random
def smoothstep(t):
"""Smooth curve with a zero derivative at 0 and 1, making it useful for
interpolating.
#distutils: language=c++
from libcpp.memory cimport shared_ptr
from cpython.buffer cimport PyObject_GetBuffer, PyBUF_FULL
cdef extern from *:
cdef cppclass CppObj:
pass
cdef shared_ptr[CppObj] cpp_function(Py_buffer *buf)
@JeffPaine
JeffPaine / i3-cheat-sheet.md
Last active March 6, 2024 08:07
i3 Window Manager Cheat Sheet

i3 Window Manager Cheat Sheet

$mod refers to the modifier key (alt by default)

General

  • startx i3 start i3 from command line
  • $mod+<Enter> open a terminal
  • $mod+d open dmenu (text based program launcher)
  • $mod+r resize mode ( or to leave resize mode)
  • $mod+shift+e exit i3