Skip to content

Instantly share code, notes, and snippets.

Avatar

Kevin Masson oktomus

View GitHub Profile
@munrocket
munrocket / wgsl_3d_sdf.md
Last active June 2, 2023 10:27
WGSL 3D SDF Primitives
View wgsl_3d_sdf.md

WGSL 3D SDF Primitives

How to use this gist:

  1. Build a sphere tracer with WebGPU (paper, paper2, youtube)
  2. Create model with sdf functions from here
  3. Add light and shadows
  4. ???
  5. PROFIT

This code tested in Chrome and Firefox, should work on PC too.

@MattRix
MattRix / UnityEditorIcons.txt
Last active May 23, 2023 08:19
A list of all the built-in EdtiorGUI icons in Unity. Use EditorGUIUtility.IconContent([icon name]) to access them.
View UnityEditorIcons.txt
ScriptableObject Icon
_Popup
_Help
Clipboard
SocialNetworks.UDNOpen
SocialNetworks.Tweet
SocialNetworks.FacebookShare
SocialNetworks.LinkedInShare
SocialNetworks.UDNLogo
animationvisibilitytoggleoff
@nop-90
nop-90 / mayaOnArchlinux.sh
Last active September 19, 2019 00:42 — forked from z3ntu/mayaOnUbuntu.sh
Shell script for installing Maya 2016 SP5 on Archlinux. Not tested yet, just copied the thing to know what to do when installing it.
View mayaOnArchlinux.sh
#!/bin/bash
# Heith Seewald 2012
# Garoe Dorta 2015
# Luca Weiss 2015
# Also based on https://gist.github.com/MichaelLawton/ee27bf4a0f591bed19ac
# Feel free to extend/modify to meet your needs.
#### Lets run a few checks to make sure things work as expected.
#Make sure we’re running with root permissions.
if [ `whoami` != root ]; then
@RichardBronosky
RichardBronosky / pep8_cheatsheet.py
Created December 27, 2015 06:25
PEP-8 cheatsheet
View pep8_cheatsheet.py
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""This module's docstring summary line.
This is a multi-line docstring. Paragraphs are separated with blank lines.
Lines conform to 79-column limit.
Module and packages names should be short, lower_case_with_underscores.
Notice that this in not PEP8-cheatsheet.py
@raine
raine / .gitconfig
Created February 27, 2015 10:12
git add with grep
View .gitconfig
[alias]
grep-add = "!sh -c 'git ls-files -m -o --exclude-standard | grep $1 | xargs git add' -"
grep-add-patch = "!sh -c 'git add -p `git ls-files -m -o --exclude-standard | grep $1`' -"
@pyguerder
pyguerder / Django-on-OVH-tutorial.md
Last active March 12, 2023 16:01
Installation de Django sur un hébergement mutualisé OVH
View Django-on-OVH-tutorial.md

La méthode présentée ici permet d'installer un site Django sur un hébergement mutualisé OVH.

Lisez d'abord le fichier README puis copiez les fichiers .htaccess et django.cgi vers votre hébergement, ainsi que le code source de Django et le code source de votre site web.

@Arakade
Arakade / gist:9dd844c2f9c10e97e3d0
Created January 3, 2015 16:54
Call from OnDrawGizmos() to draw text at Unity3D glocal position in Editor
View gist:9dd844c2f9c10e97e3d0
static void drawString(string text, Vector3 worldPos, Color? colour = null) {
UnityEditor.Handles.BeginGUI();
if (colour.HasValue) GUI.color = colour.Value;
var view = UnityEditor.SceneView.currentDrawingSceneView;
Vector3 screenPos = view.camera.WorldToScreenPoint(worldPos);
Vector2 size = GUI.skin.label.CalcSize(new GUIContent(text));
GUI.Label(new Rect(screenPos.x - (size.x / 2), -screenPos.y + view.position.height + 4, size.x, size.y), text);
UnityEditor.Handles.EndGUI();
}
@HaiyangXu
HaiyangXu / Server.py
Created May 18, 2014 14:00
A simper python http server can handle mime type properly
View Server.py
# -*- coding: utf-8 -*-
#test on python 3.4 ,python of lower version has different module organization.
import http.server
from http.server import HTTPServer, BaseHTTPRequestHandler
import socketserver
PORT = 8080
Handler = http.server.SimpleHTTPRequestHandler
@willurd
willurd / web-servers.md
Last active June 2, 2023 05:18
Big list of http static server one-liners
View web-servers.md

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@stephenhardy
stephenhardy / git-clearHistory
Created April 26, 2013 22:14
Steps to clear out the history of a git/github repository
View git-clearHistory
-- Remove the history from
rm -rf .git
-- recreate the repos from the current content only
git init
git add .
git commit -m "Initial commit"
-- push to the github remote repos ensuring you overwrite history
git remote add origin git@github.com:<YOUR ACCOUNT>/<YOUR REPOS>.git