Skip to content

Instantly share code, notes, and snippets.

@vojd
vojd / read_pixel.rs
Created July 22, 2024 10:32
Bevy read pixel
/// Shows the basics of reading a pixel color value from an `Image` in Bevy
/// Pass in a handle to indicate which `Image` you're interested in
/// In this example I'm passing in a `LevelHandle` to snag an image used for a level
pub(crate) fn read_pixel(
query: Query<&Handle<Image>, With<LevelHandle>>,
images: Res<Assets<Image>>,
) {
let handle = query.single();
// the coordinates should be passed in through a Query
@vojd
vojd / Cargo.toml
Last active October 3, 2023 18:47
Simple OpenGL window in Rust
[dependencies]
gl = "*"
glutin = "0.26"
winit = "0.24"
@vojd
vojd / gist:cdc7adb3f60e7651bd5ce160b4c46653
Created November 19, 2020 20:25
Install python3.7 on ubuntu20.04
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install python3.7
@vojd
vojd / glfw-building-dylib-for-macos-mojave-10.14.sh
Created October 28, 2018 14:20
GLFW Building .dylib for MacOS Mojave 10.14
# Fetch GLFW
wget https://github.com/glfw/glfw/archive/master.zip
unzip master
cd glfw-master/
# Configure build
export MACOSX_DEPLOYMENT_TARGET=10.14
cmake -D GLFW_NATIVE_API=1 -D CMAKE_OSX_ARCHITECTURES="x86_64" -D BUILD_SHARED_LIBS=ON -D CMAKE_C_COMPILER=clang .
# Build
@vojd
vojd / pass-through.glsl
Created October 5, 2018 17:55
Pass through Geometry shader
layout (triangles) in;
layout (triangle_strip, max_vertices = 4) out;
/**
* Simple pass-through Geometry Shader
* Assumes vertices are passed in as GL_TRIANGLES
* Change accordingly. If things doesn't work, make sure max_vertices is set to at least the number of vertices you're spitting out
*/
void main() {
@vojd
vojd / .profile
Created October 6, 2016 11:30
~/.profile
source /usr/local/etc/bash_completion.d/git-completion.bash
source /usr/local/etc/bash_completion.d/git-prompt.sh
GIT_PS1_SHOWDIRTYSTATE=true
GREEN="\[$(tput setaf 2)\]"
RESET="\[$(tput sgr0)\]"
export PS1="\[\033[38;5;39m\]\u\[$(tput sgr0)\]\[\033[38;5;104m\]@\[$(tput sgr0)\]\[\033[38;5;176m\]\w\[$(tput sgr0)\]\[\033[38;5;96m\]:\[$(tput sgr0)\]\[\033[38;5;97m\] \[$(tput sgr0)\] \w\$(__git_ps1 \" ${GREEN}(%s)${RESET} \")\$ "
@vojd
vojd / biquad_cookbook.py
Created August 4, 2016 19:34 — forked from endolith/LICENSE.txt
Python implementation of "Cookbook formulae for audio EQ biquad filter coefficients"
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 28 18:51:00 2013
UNFINISHED AND BUGGY
Python/SciPy implementation of the filters described in
"Cookbook formulae for audio EQ biquad filter coefficients"
by Robert Bristow-Johnson
http://www.musicdsp.org/files/Audio-EQ-Cookbook.txt
Id CommandLine
-- -----------
1 Invoke-Expression '. ''C:\Users\matter\Downloads\cmder\vendor\conemu-maximus5\..\profile.ps1'''
2 man Invoke-Elevated
3 Invoke-Elevated { gci }
4 Invoke-Elevated { gci }☺♂
5 install-module invoke-elevatedcommand
6 install-module psreadline
7 Set-PSReadlineOption -EditMode Emacs
@vojd
vojd / .profile
Created January 23, 2015 21:01
ssh agent - mingw32
# Note: ~/.ssh/environment should not be used, as it
# already has a different purpose in SSH.
env=~/.ssh/agent.env
# Note: Don't bother checking SSH_AGENT_PID. It's not used
# by SSH itself, and it might even be incorrect
# (for example, when using agent-forwarding over SSH).
agent_is_running() {
@vojd
vojd / gulpfile.coffee
Last active August 29, 2015 14:13
Gulp, browserify, reactify, notify and watchify for coffeescript
# Original https://gist.github.com/Sigmus/9253068
source = require 'vinyl-source-stream'
gulp = require 'gulp'
gutil = require 'gulp-util'
browserify = require 'browserify'
reactify = require 'reactify'
watchify = require 'watchify'
notify = require 'gulp-notify'