Skip to content

Instantly share code, notes, and snippets.

🎓
Hello World

Christian ChristianGreiner

🎓
Hello World
  • Germany
Block or report user

Report or block ChristianGreiner

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View textureCombine.cs
Texture2D[] layers;
Texture2D compiledTexture = new Texture2D(layers[0].width, layers[0].height);
foreach(Texture2D layer in layers){
Color[] baseColors = compiledTexture.GetPixels();
Color[] layerColors = layer.GetPixels();
for(int p = 0; p < baseColors.Length; p++){
@andrewelkins
andrewelkins / install-docker-on-linux-mint-18.sh
Last active Sep 30, 2019
Install Docker on Linux Mint 18
View install-docker-on-linux-mint-18.sh
##########################################
# To run:
# curl -sSL https://gist.githubusercontent.com/andrewelkins/1adc587feb610f586f8f40b50b7efc3a/install-docker-on-linux-mint-18.sh | bash -x
##########################################
# Kernel version http://stackoverflow.com/a/4024263
versionlte() {
[ "$1" = "`echo -e "$1\n$2" | sort -V | head -n1`" ]
}
versionlt() {
@mfep
mfep / Controller2D.cs
Created Aug 30, 2016
character controller for Duality2D
View Controller2D.cs
using System;
using System.Collections.Generic;
using System.Linq;
using Duality;
using Duality.Components.Renderers;
using Duality.Components.Physics;
namespace TilemapJam
{
View glsl-notes.md

GLSL

Keeping track of key concepts, maybe eventually make it tutorial style but is more like a reference. Based off of shader-school lessons (especially some code examples).

Spoiler warning: includes solutions to shader-school lessons.

Scalar Types

@MikeGringauz
MikeGringauz / Spaceship.cs
Last active Aug 22, 2016
TinyTween engine adopted to Duality 2D game engine with sample Spaceship component demo.
View Spaceship.cs
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using Duality;
using Duality.Components.Physics;
using Duality.Components.Renderers;
using Duality.Input;
using TinyTween;
@kundancool
kundancool / Adaway.sh
Last active Oct 4, 2019
AdAway for Linux
View Adaway.sh
#!/bin/sh
#==================================================
# AdAway implementation in shell
#==================================================
#
TMP_WORK_PATH="/tmp/.AdAway"
count=0
host_sources="https://hosts-file.net/ad_servers.txt
https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=0&mimetype=plaintext
@mitchwongho
mitchwongho / Docker
Last active Jan 18, 2020
Docker 'run' command to start an interactive BaSH session
View Docker
# Assuming an Ubuntu Docker image
$ docker run -it <image> /bin/bash
@underscorediscovery
underscorediscovery / tilt.shift.glsl
Last active Jan 7, 2020
Tilt shift shader, modified from something @grapefrukt gave me
View tilt.shift.glsl
// Modified version of a tilt shift shader from Martin Jonasson (http://grapefrukt.com/)
// Read http://notes.underscorediscovery.com/ for context on shaders and this file
// License : MIT
uniform sampler2D tex0;
varying vec2 tcoord;
varying vec4 color;
/*
Take note that blurring in a single pass (the two for loops below) is more expensive than separating
@waylaidwanderer
waylaidwanderer / install_mono.sh
Created Apr 15, 2013
Simple bash script to install the latest build of Mono
View install_mono.sh
#!/bin/bash
echo Checking for prerequisites. Please enter password if prompted.
sudo apt-get update
sudo apt-get install libpng3 libpng3-dev libtool libtiff4 libtiff4-dev libexif12 libexif-dev libgif4 libgif-dev libpango1.0-dev libatk1.0-dev bison automake autoconf make gcc gtk-sharp2 build-essential xorg-dev libfreetype6 libfontconfig libfontconfig-dev gettext libglib2.0-dev git mono-complete libjpeg-dev
echo Downloading latest build of mono...
git clone git://github.com/mono/mono.git
@vonWolfehaus
vonWolfehaus / circleVsRect.js
Last active Aug 4, 2019
Circle to rectangle collision detection
View circleVsRect.js
// limits value to the range min..max
function clamp(val, min, max) {
return Math.max(min, Math.min(max, val))
}
// Find the closest point to the circle within the rectangle
// Assumes axis alignment! ie rect must not be rotated
var closestX = clamp(circle.X, rectangle.x, rectangle.x + rectangle.width);
var closestY = clamp(circle.Y, rectangle.y, rectangle.y + rectangle.height);
You can’t perform that action at this time.