This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def bresenham(startPoint, endPoint): | |
startPoint = [int(startPoint[0]),int(startPoint[1]),int(startPoint[2])] | |
endPoint = [int(endPoint[0]),int(endPoint[1]),int(endPoint[2])] | |
steepXY = (abs(endPoint[1] - startPoint[1]) > abs(endPoint[0] - startPoint[0])) | |
if(steepXY): | |
startPoint[0], startPoint[1] = startPoint[1], startPoint[0] | |
endPoint[0], endPoint[1] = endPoint[1], endPoint[0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
suits = [ | |
'Hearts', | |
'Diamonds', | |
'Clubs', | |
'Spades' | |
] | |
values = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'Jack', 'Queen', 'King'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void fshader( | |
in float3 l_texcoord0 : TEXCOORD0, //normals | |
in float4 l_texcoord1 : TEXCOORD1, | |
in float4 l_color : COLOR, | |
uniform sampler2D tex_0, | |
uniform sampler2D tex_1, | |
uniform sampler2D tex_2, | |
uniform sampler2D tex_3, | |
uniform sampler2D tex_4, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$background_color = substr(md5($unique_id),0,6); | |
$r = hexdec(substr($background_color,0,2)); | |
$g = hexdec(substr($background_color,2,2)); | |
$b = hexdec(substr($background_color,4,2)); | |
$l = ($r*0.2126)+($g*0.7152)+($b*0.0722); | |
$text_color = ($l >= 128)? '000000' : 'ffffff'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CC = gcc | |
CXX = g++ | |
RM = rm -f | |
LDLIBS = \ | |
-L/usr/X11R6/lib$(LIBSELECT) \ | |
-L../libs/irrlicht-1.8.0/lib/Linux \ | |
-L../libs/accidentalnoise/lib/Linux \ | |
-lIrrlicht \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dropBlocks: function() { | |
for(var y = this.mapsize.y -2; y >= 0; y --) | |
{ | |
for(var x = 0; x < this.mapsize.x; x++) | |
{ | |
if(this.map[x][y] != null) { | |
if(this.map[x][y+1] == null && this.map[x][y].pos.y == y * 64 + this.offset.y) | |
{ | |
this.map[x][y+1] = this.map[x][y]; | |
this.map[x][y] = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Configure colors, if available. | |
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then | |
c_reset='\[\e[0m\]' | |
c_user='\[\e[0;32m\]' | |
c_path='\[\e[1;34m\]' | |
c_git_clean='\[\e[0;37m\]' | |
c_git_staged='\[\e[0;32m\]' | |
c_git_unstaged='\[\e[0;31m\]' | |
else | |
c_reset= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- default rc.lua for shifty | |
-- | |
-- Standard awesome library | |
require("awful") | |
require("awful.autofocus") | |
-- Theme handling library | |
require("beautiful") | |
-- Notification library | |
require("naughty") | |
-- shifty - dynamic tagging library |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import collectd | |
import random | |
import transmissionrpc | |
pending = 0 | |
checking = 0 | |
downloading = 0 | |
seeding = 0 | |
stopped = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* OpenSimplex (Simplectic) Noise for 3D in Java | |
* (Preliminary Release) | |
* | |
* KdotJPG | |
*/ | |
public class OpenSimplexNoise { | |
private static final double STRETCH_CONSTANT_3D = -1.0 / 6; |
OlderNewer