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
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; |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using Duality; | |
using Duality.Components.Renderers; | |
using Duality.Components.Physics; | |
namespace TilemapJam | |
{ |
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
#!/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 |
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
########################################## | |
# 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() { |
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
# http://tanner-tech.googlecode.com/svn-history/r197/trunk/NewWorldMap/cardgen/eniCards.py | |
import Image, ImageDraw, ImageFont | |
# load an existing image | |
photo = Image.open("lyn.jpg") | |
photoSize = photo.size | |
# create a new, empty image | |
card = Image.new('RGB', (600, 600), color=(255,255,255)) |
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
// 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); |
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
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++){ |
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
package com.atlas.fps; | |
import java.awt.Canvas; | |
import java.awt.Color; | |
import java.awt.Graphics; | |
import java.awt.image.BufferStrategy; | |
import javax.swing.JFrame; | |
public class AtlasFPSLimiter extends Canvas implements Runnable { |
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 os | |
import json | |
def path_to_dict(path): | |
d = {'name': os.path.basename(path)} | |
if os.path.isdir(path): | |
d['type'] = "directory" | |
d['children'] = [path_to_dict(os.path.join(path,x)) for x in os.listdir\ | |
(path)] | |
else: |
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
#!/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 |
OlderNewer