Skip to content

Instantly share code, notes, and snippets.

View MSylvia's full-sized avatar
💭
Compiling ....

Matt Sylvia MSylvia

💭
Compiling ....
View GitHub Profile
private static Vector2 WorldToPixelCoords(Vector3 projectedPoint, Sprite sprite, Transform transform)
{
var textureRect = sprite.textureRect;
var spriteBounds = sprite.bounds;
var localPoint = transform.InverseTransformPoint(projectedPoint);
localPoint.x = (localPoint.x - spriteBounds.min.x) / (spriteBounds.size.x);
localPoint.y = (localPoint.y - spriteBounds.min.y) / (spriteBounds.size.y);
package computer;
// Referenced classes of package computer:
// KeyMapping
public class AWTKeyMapping extends KeyMapping
{
public AWTKeyMapping()
@MSylvia
MSylvia / README.md
Created November 27, 2015 19:20 — forked from cjrd/README.md
Interactive tool for creating directed graphs using d3.js.

directed-graph-creator

Interactive tool for creating directed graphs, created using d3.js.

Demo: http://bl.ocks.org/cjrd/6863459

Operation:

  • drag/scroll to translate/zoom the graph
@MSylvia
MSylvia / keybase.md
Created February 10, 2016 15:41
Keybase

Keybase proof

I hereby claim:

  • I am msylvia on github.
  • I am msylvia (https://keybase.io/msylvia) on keybase.
  • I have a public key whose fingerprint is FA23 D366 C3D7 D17F C5CD 2154 F378 5268 B796 019E

To claim this, I am signing this object:

@MSylvia
MSylvia / tmux.c
Created August 18, 2016 15:06 — forked from spacelatte/tmux.c
tmux guest session
// tmux.c
// compile using: cc -o tmux tmux.c
// makeit setuid executable by: chmod +s tmux
// also change owner to desired user: [sudo] chown {usernamehere} tmux
// give it to guests' shell (passwd entry): guest::9999:99:guest user:/tmp:/opt/tmux
// you can delete password with passwd -du {login}
// allow empty passwords with PermitEmptyPasswords yes in sshd_config
// update (18 aug 2016): added dynamic owner change, for security ofc :)
@MSylvia
MSylvia / PhpJava.java
Created September 1, 2016 14:34 — forked from avafloww/PhpJava.java
This snippet of code is syntactically valid in both PHP and Java, and produces the same output in both.
/*<?php
//*/public class PhpJava { public static void main(String[] args) { System.out.printf("/*%s",
//\u000A\u002F\u002A
class PhpJava {
function main() {
echo(//\u000A\u002A\u002F
"Hello World!");
}}
//\u000A\u002F\u002A
PhpJava::main();
@MSylvia
MSylvia / CustomInspectorCreator.cs
Created January 19, 2017 04:35 — forked from LotteMakesStuff/CustomInspectorCreator.cs
Editor extension that adds a tool to automagically generate boilerplate custom inspector code~ YES! Just drop it into a folder called 'Editor' and it adds a 'custom inspector' option into the Project window!
using UnityEngine;
using UnityEditor;
using System.IO;
using System.Collections;
public static class CustomInspectorCreator
{
[MenuItem("Assets/Create/Custom Inspector", priority = 81)]
static void CreateInsptorEditorClass()
{
@MSylvia
MSylvia / MaximalRectangle.java
Created March 18, 2017 04:51 — forked from mmadson/MaximalRectangle.java
Daveed V's Maximal Rectangle algorithm in Java
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.LinkedList;
import java.util.Scanner;
import java.util.Stack;
final class Cell {
final int col;
final int row;
@MSylvia
MSylvia / find_rects.cpp
Created March 18, 2017 15:56 — forked from pelya/find_rects.cpp
Find all rectangles in a 2D array, trying to cover as much area with as little amount of rectangles as possible. http://stackoverflow.com/questions/5810649/finding-rectangles-in-a-2d-block-grid
#include <stdlib.h>
#include <vector>
#include <utility>
#include <algorithm>
#include "find_rects.hpp"
namespace FindRects {
/* Algorithm was taken from here: http://stackoverflow.com/a/20039017/624766