Skip to content

Instantly share code, notes, and snippets.

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

Matt Sylvia MSylvia

💭
Compiling ....
View GitHub Profile
// Written by Michael 'Searge' Stoyke in 03/2015
// Released as public domain, do whatever you want with it!
using System;
using System.IO;
using System.Reflection;
using System.Text;
using Mono.CSharp;
namespace GameLibrary {
def Process.gsub pat, sub
mem = File.open('/proc/self/mem', 'r+')
maps = File.open('/proc/self/maps')
maps.each do |map|
from, to, perms, offset = map.scan(/(\h+)-(\h+) (\S+) (\h+)/)[0]
if perms['rw']
from, to = [from, to].map { |addr| addr.hex + offset.hex }
data = mem.tap { |m| m.seek from }.read(to - from) rescue next
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 / 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;