Skip to content

Instantly share code, notes, and snippets.

@seobyeongky
seobyeongky / gist:78b659accacac2051770ac9ee54dc8d6
Created November 25, 2023 05:19
Triangle fill algorithm (scanline)
//modified from : http://www.sunshine2k.de/coding/java/TriangleRasterization/TriangleRasterization.html
public static IEnumerable<Vector2Int> FillTriangleInGrid(Vector2 a, Vector2 b, Vector2 c, RectInt texRect)
{
/* at first sort the three vertices by y-coordinate ascending so v1 is the topmost vertice */
if (a.y < b.y)
swap(ref a, ref b);
if (b.y < c.y)
swap(ref b, ref c);
if (a.y < b.y)
swap(ref a, ref b);
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using UnityEditor;
using UnityEditor.EditorTools;
using UnityEditor.Tilemaps;
using UnityEngine;
using UnityEngine.SceneManagement;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using System.Text.RegularExpressions;
using UnityEditor;
using UnityEngine;
[InitializeOnLoad]
@seobyeongky
seobyeongky / gist:43cbe66fa7d653fa0bb9
Created September 23, 2014 02:30
외곽선 따라 돌아가는 효과?
{advance} = require './utils'
RIGHT = 0
UP = 1
LEFT = 2
DOWN = 3
CCW_DIRECTION = [RIGHT,UP,LEFT,DOWN]
CCW_OFFSET = [[1,0],[0,1],[-1,0],[0,-1]] #right,up,left,down
THE_RIHGTSIDE_POINT_OFFSET = [[1,0],[1,1],[0,1],[0,0]]
HORIZONTAL = 0
sudo ipfw add 100 fwd 127.0.0.1, $1 tcp from any to any $2 in
bytesize=$(wc -c $1 | awk '{print $1}')
cat $1
tail -F -c $bytesize $1
# install git
sudo apt-get install git
# download docker
git clone https://github.com/dotcloud/docker.git
cd docker
#edit Vagrantfile... (port forwarding)
rundb.sh 파일입니다... chmod +x 하고 써야돼요. 그리고 db랑 server 다 test브렌치에 새버전 있어요
RED='\e[0;31m'
YELLOW='\e[1;33m'
CYAN='\e[0;36m'
NC='\e[0m'
if [ $# = 0 ] || [ $1 = "-h" ] || [ $1 = "--help" ]
then
export DOCKER_REDIS=$(docker ps | grep redis | awk {'print $1'})
export DOCKER_ZOOKEEPER=$(docker ps | grep zookeeper | awk {'print $1'})
export DOCKER_MONGODB=$(docker ps | grep mongodb | awk {'print $1'})