Skip to content

Instantly share code, notes, and snippets.

View JeremyMeissner's full-sized avatar
🧭

Jeremy Meissner JeremyMeissner

🧭
View GitHub Profile

Guide to using OpenGL's GL.DebugMessageCallback()

When learning OpenGL, one of the most common sources of bugs you'll encounter is from performing OpenGL API calls with invalid arguments, performing them in the wrong order, or performing calls that assume some OpenGL state that differs from the actual state.

With most well-written C# APIs, you'd get an exception thrown the moment you do something you shouldn't. By default, this doesn't happen with OpenGL, but there are still ways to tell if there are errors:

The easy (but tedious) way

The common way to check for errors is to use GL.GetError() to check for errors, often with a helper method such as the following:

@xon52
xon52 / xon-GridCanvas.vue
Last active March 5, 2024 09:23
Medium - Flexible Canvas Grid (without blurred lines)
<template>
<canvas class="gridCanvas"
:width="width"
:height="height"
></canvas>
</template>
<script>
export default {
name: 'xon-GridCanvas',
@jaytaylor
jaytaylor / react-unexpected-use-of-location.md
Created July 12, 2017 22:44
Solution for "Unexpected use of 'location'" React error.
React: Unexpected use of 'location';

Solution: Use window.location instead of bare location.

@keithweaver
keithweaver / create-folder.py
Created March 10, 2017 03:42
Create a folder with Python
import os
def createFolder(directory):
try:
if not os.path.exists(directory):
os.makedirs(directory)
except OSError:
print ('Error: Creating directory. ' + directory)
@gunjanpatel
gunjanpatel / revert-a-commit.md
Last active April 21, 2024 22:10
Git HowTo: revert a commit already pushed to a remote repository

Revert the full commit

Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.

git revert {commit_id}

About History Rewriting

Delete the last commit

Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:

@mandiwise
mandiwise / Update remote repo
Last active April 17, 2024 07:41
Transfer repo from Bitbucket to Github
// Reference: http://www.blackdogfoundry.com/blog/moving-repository-from-bitbucket-to-github/
// See also: http://www.paulund.co.uk/change-url-of-git-repository
$ cd $HOME/Code/repo-directory
$ git remote rename origin bitbucket
$ git remote add origin https://github.com/mandiwise/awesome-new-repo.git
$ git push origin master
$ git remote rm bitbucket