Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View prucha's full-sized avatar
🛠️
Oculus Questing...

Milan prucha

🛠️
Oculus Questing...
View GitHub Profile
@prucha
prucha / VideoScrubbingCinderApp.cpp
Last active August 29, 2015 14:16
Video Scrubbing With Cinder (Mac OSX / Xcode)
// Video Scrubbing With Cinder (Mac OSX)
// -------------------------------------
/*
Create a Cinder project in Xcode (adding the QuickTime Cinder Block).
Then use this code in your main App cpp.
When the app running, you should be able to scrub the video by dragging the mouse
horizontally across the app window.
*/
#include "cinder/app/AppNative.h"
@prucha
prucha / OpenFileInDefaultApp.cpp
Created May 6, 2015 22:16
Open a file in its default program (Windows)
// Opening a File (e.g. Video) in its default program
// --------------------------------------------------
/*
This method, using the 'ShellExecute' command, only works in Windows
(tested in Windows 7).
The code snippet was taken from an App created using Cinder,
a C++ Framework for Creative Coding: http://libcinder.org/
However, 'ShellExecute' should work in standard Windows Desktop Apps.
@prucha
prucha / A_CinderStateMachineApp.cpp
Last active August 29, 2015 14:21
A 'Finite State Machine' implemented in a Cinder App
// 'Finite State Machine' in Cinder
// --------------------------------
// Created by Milan Prucha on 14/05/2015.
/*
1) Create a new Cinder project in Xcode / Visual Studio.
2) Add the other h/cpp files (included below) to your project.
3) Then use the code in this cpp, in your main Cinder App cpp.
*/
@prucha
prucha / Swift_VideoPlayerViewController.swift
Last active August 29, 2015 14:22
Play Video via Native Video Player (Swift vs Xamarin)
// This code snippet was taken from a very simple iPad App, that plays an embedded video file
// via the native IOS video player. The App was set up with a single 'View'.
// The code below is from the 'ViewController', which contains the only significant code
// to be added to the standard template.
// The full project was created in Xcode, using the Apple Swift language
import UIKit
import MediaPlayer
class Swift_VideoPlayerViewController: UIViewController {
@prucha
prucha / Fixed-Unlit.shader
Last active April 1, 2016 17:38
Bare-bones Unity Shader
Shader "Milan/Fixed Unlit"
{
Properties
{
_Color("Main Color", Color) = (1,1,1,1)
}
SubShader
{
Pass
@prucha
prucha / Texture-Unlit.shader
Created April 1, 2016 20:54
Basic Texture Shader
Shader "Milan/Texture Unlit"
{
Properties
{
_Color("Main Color", Color) = (1,1,1,1)
_MainTex("Main Texture", 2D) = "white" {}
}
SubShader
{
@prucha
prucha / c-sharp-serial-comm.cs
Created March 5, 2018 18:22
C# <-> Serial Comm
//Socket Code can be used to read serial data being relayed via tinkerproxy.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
@prucha
prucha / UnityMeshCreator.cs
Last active March 31, 2024 15:45
Unity: Creating a Mesh in code
using UnityEngine;
using System.Collections;
// This Unity script demonstrates how to create a Mesh (in this case a Cube) purely through code.
// Simply, create a new Scene, add this script to the Main Camera, and run.
public class UnityMeshCreator : MonoBehaviour {
GameObject _cube;