Skip to content

Instantly share code, notes, and snippets.

@bbeaumont
bbeaumont / Bevel.cs
Last active July 1, 2021 20:13
Unity UI Bevel or Emboss effect
using System.Collections.Generic;
namespace UnityEngine.UI
{
[AddComponentMenu("UI/Effects/Bevel", 15)]
public class Bevel : Shadow
{
[SerializeField] private Color highlightColor;
protected Bevel()
extends layout
block content
h1 title
form(action='/submitform', method='post', enctype="multipart/form-data")
label(for='myinput') Input
input(name='myinput',id='myinput',type='text')
input(type="file", name="jsonfile")
input(type='submit',value='Submit')
@bbeaumont
bbeaumont / testform.js
Created July 1, 2013 22:28
simple form upload
/*
* GET home page.
*/
var fs = require('fs');
exports.thing = function (req, res) {
res.render('testform', { title: 'Test form' });
};
exports.submitform = function(req,res) {
console.log(req.files);
@bbeaumont
bbeaumont / gist:4335783
Created December 19, 2012 10:26
Get the relative sides of two objects
function getSide(targetPosition:Point, currentPosition:Point, currentDirection:Point):int
{
var positionDelta:Point = new Point(
targetPosition.x - currentPosition.x,
targetPosition.y - currentPosition.y
);
var direction:Number = positionDelta.x*-currentDirection.y + positionDelta.y*currentDirection.x;
if (direction < 0.0)
return 1;
else if (direction > 0.0)