Skip to content

Instantly share code, notes, and snippets.

View naruse's full-sized avatar

Juan Sebastian Muñoz naruse

  • Pencil Square Games
  • Canada
View GitHub Profile
#include <iostream>
using namespace::std;
int width = -1;
int height = -1;
char** mineBoard;
int main(int argc, char* argv[]) {
while (width != 0 && height != 0) {
#include "Matrix.h"
float const Matrix::identityMatrix[] = {
1,0,0,0,
0,1,0,0,
0,0,1,0,
0,0,0,1
};
Matrix Matrix::MultiplyMatrices(const Matrix* m1, const Matrix* m2) {
-*- mode: compilation; default-directory: "~/dev/OpenGL/Test73DOpenGL/" -*-
Compilation started at Mon Jun 1 13:49:42
make -k \
g++ -I/usr/local/include main.cpp Vertex.cpp Matrix.cpp Utils.cpp -o main -L/usr/local/lib -lglfw3 -framework Cocoa -framework OpenGL -framework IOKit -framework CoreFoundation -framework CoreVideo -lGLEW
Matrix.cpp:13:14: error: array type 'float [16]' is not assignable
result.m = Matrix::Identity();
~~~~~~~~ ^
1 error generated.
make: *** [all] Error 1
using UnityEngine;
using System.Collections;
public class ExampleClass : MonoBehaviour {
public Transform gunObj;
void Update() {
if (Input.GetMouseButton(0)) {
RaycastHit hit;
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
if (Physics.Raycast(ray, out hit)) {
/*
Created by
Juan Sebastian Munoz Arango
naruse@gmail.com
all rights reserved
*/
namespace ProDrawCall {
using System;
using System.Collections.Generic;
/*
Created by
Juan Sebastian Munoz Arango
naruse@gmail.com
all rights reserved
*/
namespace ProDrawCall {
using System;
using System.Collections.Generic;
[MenuItem("FixLODRendeer")]
static void LODRendeer()
{
LODGroup[] lodgroups = (LODGroup[])GameObject.FindObjectsOfType(typeof(LODGroup));
//For every LOD group: get the current groups and get the renderer names..
foreach (LODGroup lodgroup in lodgroups)
{
SerializedObject obj = new SerializedObject(lodgroup);
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
public class LODFixer {
[MenuItem("Window/FixLODRendeer")]
static void LODRendeer()
/*
Problem:
Given 2 strings, write a method to know if one is a permutation of the
other.
Approach:
if we assume the string is in ASCII, we can use an integer array of 256
chars and mark the used chars and add them.
Assuming the interviewer mentions the string is in UNICODE, then the max #
@naruse
naruse / Part1.cpp
Created December 17, 2018 19:24
Advent Of Code Day 4 Part 1 2018 C++.
/*
--- Day 4: Repose Record ---
You've sneaked into another supply closet - this time, it's across
from the prototype suit manufacturing lab. You need to sneak inside
and fix the issues with the suit, but there's a guard stationed
outside the lab, so this is as close as you can safely get.
As you search the closet for anything that might help, you discover
that you're not the first person to want to sneak in. Covering the
walls, someone has spent an hour starting every midnight for the past