Skip to content

Instantly share code, notes, and snippets.

View misato's full-sized avatar
👾
Coding...

misato misato

👾
Coding...
View GitHub Profile
@misato
misato / SnapToGrid.cs
Created March 26, 2018 10:37
Script to Snap to Grid objects in Unity, so it's pixel perfect
using UnityEngine;
public class SnapToGrid : MonoBehaviour {
public float PPU = 19; // pixels per unit (your tile size)
private void LateUpdate() {
Vector3 position = transform.localPosition;
position.x = (Mathf.Round(transform.parent.position.x * PPU) / PPU) - transform.parent.position.x;
position.y = (Mathf.Round(transform.parent.position.y * PPU) / PPU) - transform.parent.position.y;
@misato
misato / debug.js
Created November 8, 2017 10:09
Debug utilities for Fitbit Ionic
import { memory } from "system";
// Debug logs.
// Set `debugEnabled` to false hide debug logs
var debugEnabled = true;
export function log(message) {
if (debugEnabled) {
console.log(message);
}
@misato
misato / MapViewController.swift
Created January 18, 2017 10:42
Mapbox iOS GeoJSON with clustering example (swift)
//
// MapViewController.swift
// Mapbox Clustering Test
//
// Created by Ester Sanchez on 18/01/17.
// Copyright © 2017 misato.es. All rights reserved.
//
import UIKit
import Mapbox