Skip to content

Instantly share code, notes, and snippets.

@davidedmundson
davidedmundson / PlasmaNested.sh
Last active August 23, 2024 16:59
Run plasma from within gamescope
#!/bin/sh
# Remove the performance overlay, it meddles with some tasks
unset LD_PRELOAD
## Shadow kwin_wayland_wrapper so that we can pass args to kwin wrapper
## whilst being launched by plasma-session
mkdir $XDG_RUNTIME_DIR/nested_plasma -p
cat <<EOF > $XDG_RUNTIME_DIR/nested_plasma/kwin_wayland_wrapper
#!/bin/sh
@FreyaHolmer
FreyaHolmer / MathWishlist.cs
Created January 15, 2020 12:07
Things I'd love to have in Unity's Mathf and Vector classes~
public class MathWishlist {
// Mathf
public const float TAU = 6.28318530717959f;
public static float Frac( float x ) => x - Mathf.Floor( x );
public static float Smooth01(float x) => x * x * (3 - 2 * x);
public static float InverseLerpUnclamped( float a, float b, float value) => (value - a) / (b - a);
public static float Remap(float iMin, float iMax, float oMin, float oMax, float value) {
float t = Mathf.InverseLerp(iMin, iMax, value);
return Mathf.Lerp( oMin, oMax, t );
@ChristophHaag
ChristophHaag / PKGBUILD
Last active April 27, 2018 16:57
PKGBUILD mesa git for tegra
pkgname=mesa-full-tegra
pkgver=r100838.c9b153fea7
_realver=18.0
pkgrel=1
pkgdesc="Full Mesa 3D graphics library with all its components, built from the git master branch. Compiles tegra"
arch=(armv7h)
url="http://mesa3d.org/"
license=('LGPL')
depends=('libdrm' 'dri2proto' 'glproto' 'libxxf86vm' 'libxdamage' 'expat>=2.0.1' 'libxmu' 'talloc' 'llvm' 'wayland' 'libxvmc' 'python2-mako' 'libxcb')
makedepends=('pkgconfig' 'imake' 'xorg-server-devel' 'meson')
@dvddarias
dvddarias / Arrows2DMovement.cs
Last active May 5, 2024 05:32
Unity editor script to precisely move, rotate and scale GameObjects on a 2D scene, using the arrow keys.
/*
Unity editor script to precisely move, rotate and scale GameObjects on 2D scenes, using the arrow keys.
Notes:
- To use it just include it on an "Assets/Editor" folder on your project.
- The action depends on the selected tool and the size of the movement depends on the Scene view zoom.
- The more "zoomed in" is the scene view the smaller is the movement step.
- It will work when the current Scene tab is in 2D mode and there is at least one gameObject selected,
otherwise the scene camera will move as usual :)
@vkobel
vkobel / .Xresources
Created June 10, 2016 13:02
Custom monokai themed Xresources file (tested with URxvt and i3)
! special
*.foreground: #d1d1d1
! *.background: #221e2d
*.cursorColor: #d1d1d1
! black
*.color0: #272822
*.color8: #75715e
! red
@paulallies
paulallies / gist:0052fab554b14bbfa3ef
Last active August 3, 2024 16:45
Remove node_modules from git repo
#add 'node_modules' to .gitignore file
git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin <branch-name>
@protrolium
protrolium / YouTube API — getting video thumbnail
Created February 5, 2014 19:57
YouTube API — getting video thumbnail
Each YouTube video has 4 generated images. They are predictably formatted as follows:
http://img.youtube.com/vi/<insert-youtube-video-id-here>/0.jpg
http://img.youtube.com/vi/<insert-youtube-video-id-here>/1.jpg
http://img.youtube.com/vi/<insert-youtube-video-id-here>/2.jpg
http://img.youtube.com/vi/<insert-youtube-video-id-here>/3.jpg
The first one in the list is a full size image and others are thumbnail images. The default thumbnail image (ie. one of 1.jpg, 2.jpg, 3.jpg) is:
http://img.youtube.com/vi/<insert-youtube-video-id-here>/default.jpg