Skip to content

Instantly share code, notes, and snippets.

View discordier's full-sized avatar
🥵

Christian Schiffler discordier

🥵
View GitHub Profile
@dwilliamson
dwilliamson / ModifiedMarchingCubes.js
Created February 8, 2022 16:20
Transvoxel's Modified Marching Cubes Lookup Tables
//
// Lookup Tables for Transvoxel's Modified Marching Cubes
//
// Unlike the original paper (Marching Cubes: A High Resolution 3D Surface Construction Algorithm), these tables guarantee
// a closed mesh "whose connected components are continuous and free of holes."
//
// Rotations are prioritised over inversions so that 3 of the 6 cases containing ambiguous faces are never added. 3 extra
// cases are added as a post-process, overriding inverses through custom-build rotations to eliminate the rest.
//
// Uses the exact same co-ordinate system as https://gist.github.com/dwilliamson/c041e3454a713e58baf6e4f8e5fffecd
@janeczku
janeczku / 00-cloud-config.yml
Last active June 10, 2023 15:10
Annotated RancherOS Cloud-init configuration snippets
#cloud-config
# Set the hostname for this machine (takes precedence over hostname assigned by DHCP lease).
hostname: myhost
# Authorize SSH keys for the `rancher` sudoer user
ssh_authorized_keys:
- ssh-rsa AAA...ZZZ example1@rancher
@roboshoes
roboshoes / index.html
Last active February 16, 2019 09:24
Basic setup with no dependencies to render fullscreen fragment shaders.
<!DOCTYPE html>
<html>
<head>
<style>
html, body {
margin: 0;
padding: 0;
overflow: hidden;
}
@JamesMGreene
JamesMGreene / gitflow-breakdown.md
Last active April 16, 2024 16:36
`git flow` vs. `git`: A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@tristanlins
tristanlins / quick-flow.sh
Last active July 10, 2017 21:13
Quick creation of new releases with git flow, without using the release branch.
#!/bin/bash
TAG=$1
if [[ -z "$TAG" ]]; then
echo "No tag specified!"
exit 1
fi
if [[ -n "$(git status --porcelain)" ]]; then
echo "Uncommited changes detected!"
@tristanlins
tristanlins / git-mass-status.sh
Last active August 29, 2015 13:57
Script to find GIT repositories that have modified files and unpublished commits.
#!/bin/bash
BASEDIR=$(pwd)
find -type d -name .git | while read GITDIR; do
DIR=$(dirname $GITDIR)
cd "$BASEDIR/$DIR"
STATUS=$(git status -s)
if [[ -n "$STATUS" ]]; then
echo '--- modifications --------------------------------------------------------------'
pwd
@asafge
asafge / ng-really.js
Created November 12, 2013 13:06
ng-really? An AngularJS directive that creates a confirmation dialog for an action.
/**
* A generic confirmation for risky actions.
* Usage: Add attributes: ng-really-message="Are you sure"? ng-really-click="takeAction()" function
*/
angular.module('app').directive('ngReallyClick', [function() {
return {
restrict: 'A',
link: function(scope, element, attrs) {
element.bind('click', function() {
var message = attrs.ngReallyMessage;
@tristanlins
tristanlins / Contao2ClassLoaderHack.php
Last active December 27, 2015 17:39
Hacking the Contao 2 classes cache and overwrite with a class_exists check, so Controller::classFileExists() will return true, even if the class file does not exist in any system/modules/* directory.
<?php
/**
* Hack the Contao2 Controller::classFileExists()
*
* (c) Tristan Lins <tristan.lins@bit3.de>
* Christian Schiffler <c.schiffler@cyberspectrum.de>
*
* @author Tristan Lins <tristan.lins@bit3.de>
* @license MIT
@ziadoz
ziadoz / Version20121011141021.php
Created October 11, 2012 20:53
Doctrine DBAL and Migrations Example
<?php
/*
* /path/to/migrations/directory/Version20121011141021.php
*/
namespace ExampleMigrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
class Version20121011141021 extends AbstractMigration
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: