Skip to content

Instantly share code, notes, and snippets.

View osmanzeki's full-sized avatar
👋
Oh hi!

Osman Zeki osmanzeki

👋
Oh hi!
View GitHub Profile
@osmanzeki
osmanzeki / Google_Colaboratory_backup.py
Created February 27, 2020 06:13 — forked from rdinse/Google_Colaboratory_backup.py
Simple Google Drive backup script with automatic authentication for Google Colaboratory (Python 3)
# Simple Google Drive backup script with automatic authentication
# for Google Colaboratory (Python 3)
# Instructions:
# 1. Run this cell and authenticate via the link and text box.
# 2. Copy the JSON output below this cell into the `mycreds_file_contents`
# variable. Authentication will occur automatically from now on.
# 3. Create a new folder in Google Drive and copy the ID of this folder
# from the URL bar to the `folder_id` variable.
# 4. Specify the directory to be backed up in `dir_to_backup`.
@osmanzeki
osmanzeki / ARKitDefines.h
Last active July 12, 2021 16:30
AR Foundation Extension to bring back the ARKit `setWorldOrigin` functionality into AR Foundation 3.0.1. This feature was previously supported by the now depreciated official `Unity-ARKit-Plugin`.
// Unity Technologies Inc (c) 2017
// ARKitDefines.h
// 2020-01-05: @osmanzeki => Adapted as an AR Foundation Extension from features originally implemented in the depreciated official `Unity-ARKit-Plugin`.
#import <ARKit/ARKit.h>
typedef struct
{
float x,y,z,w;
@osmanzeki
osmanzeki / Makefile
Created October 9, 2019 12:05 — forked from sighingnow/Makefile
Detect operating system in Makefile.
# Detect operating system in Makefile.
# Author: He Tao
# Date: 2015-05-30
OSFLAG :=
ifeq ($(OS),Windows_NT)
OSFLAG += -D WIN32
ifeq ($(PROCESSOR_ARCHITECTURE),AMD64)
OSFLAG += -D AMD64
endif
@osmanzeki
osmanzeki / AudioManager.cs
Created March 7, 2019 20:33 — forked from phosphoer/AudioManager.cs
Simple Unity AudioManager
// The MIT License (MIT)
// Copyright (c) 2017 David Evans @phosphoer
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
@osmanzeki
osmanzeki / BuildDefinition.cs
Created March 7, 2019 20:33 — forked from phosphoer/BuildDefinition.cs
Create build definition assets in Unity and build multiple platforms / builds with different scenes at once with the click of a button!
// The MIT License (MIT)
// Copyright (c) 2017 David Evans @phosphoer
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
@osmanzeki
osmanzeki / Validation.php
Created February 27, 2019 21:17
Proof-of-concept (dirty) fix for OctoberCMS translatable fields not being validated properly.
<?php namespace October\Rain\Database\Traits;
use App;
use Lang;
use Input;
use October\Rain\Database\ModelException;
use Illuminate\Support\MessageBag;
use Illuminate\Support\Facades\Validator;
use Exception;
@osmanzeki
osmanzeki / Validation.php
Created February 27, 2019 21:17
Proof-of-concept (dirty) fix for OctoberCMS translatable fields not being validated properly.
<?php namespace October\Rain\Database\Traits;
use App;
use Lang;
use Input;
use October\Rain\Database\ModelException;
use Illuminate\Support\MessageBag;
use Illuminate\Support\Facades\Validator;
use Exception;
@osmanzeki
osmanzeki / CameraPlane.cs
Created July 10, 2017 14:43 — forked from mstevenson/CameraPlane.cs
A simple solution for grabbing and dragging physics objects in Unity. Attach a DragRigidbody component to an object that has a both collider and a rigidbody. Add the object to a layer named "Interactive".
using UnityEngine;
using System.Collections;
/// <summary>
/// Utility class for working with planes relative to a camera.
/// </summary>
public static class CameraPlane
{
/// <summary>
/// Returns world space position at a given viewport coordinate for a given depth.
@osmanzeki
osmanzeki / SaveFBX.cs
Created July 10, 2017 12:03 — forked from mstevenson/SaveFBX.cs
ASCII FBX file exporter for Unity. Extracted from Michal Mandrysz's Unity Summer of Code 2009 external lightmapping project.
using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using UnityEditor;
using UnityEngine;
/*
@osmanzeki
osmanzeki / GravityItem.cs
Created May 24, 2017 17:42 — forked from phosphoer/GravityItem.cs
Mario Galaxy Gravity for Unity
// The MIT License (MIT)
// Copyright (c) 2016 David Evans @phosphoer
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR