Skip to content

Instantly share code, notes, and snippets.

View 3dln's full-sized avatar
🌞
blessed

Ashkan Ashtiani 3dln

🌞
blessed
View GitHub Profile
@3dln
3dln / CameraOrbit.cs
Last active April 24, 2024 16:32
A simple Unity C# script for orbital movement around a target gameobject
// A simple Unity C# script for orbital movement around a target gameobject
// Author: Ashkan Ashtiani
// Gist on Github: https://gist.github.com/3dln/c16d000b174f7ccf6df9a1cb0cef7f80
using System;
using UnityEngine;
namespace TDLN.CameraControllers
{
public class CameraOrbit : MonoBehaviour
@3dln
3dln / MaterialChanger.cs
Created September 19, 2018 08:35
A Simple Script to change the materials on a game object and all the nested children
// A Simple Script to change the materials on a game object and all the nested children
// Author: Ashkan Ashtiani
// Github: https://github.com/3dln/material_changer
using System.Collections.Generic;
using UnityEngine;
namespace TDLN
{
public class MaterialChanger : MonoBehaviour
@3dln
3dln / DepthMask.shader
Created September 21, 2018 06:12
Depth mask is a shader for concealing objects in AR used for AR window effects and hiding underground models
Shader "DepthMask" {
SubShader {
// Render the mask after regular geometry, but before masked geometry and
// transparent things.
Tags {"Queue" = "Geometry-10" }
// Turn off lighting, because it's expensive and the thing is supposed to be
// invisible anyway.
@3dln
3dln / ModelAnimation.cs
Created September 23, 2018 08:22
Adds scale, rotate and move animation loops to the game objects
using UnityEngine;
using System.Collections;
public class ModelAnimation : MonoBehaviour {
public bool isAnimated = false;
public bool isRotating = false;
public bool isFloating = false;
public bool isScaling = false;
@3dln
3dln / debug_stuff.py
Created May 25, 2019 07:35 — forked from dhrrgn/debug_stuff.py
A handy SQL debug function for Flask-SQLAlchemy
from . import app
from flask.ext.sqlalchemy import get_debug_queries
if app.debug:
app.after_request(sql_debug)
def sql_debug(response):
queries = list(get_debug_queries())
query_str = ''
@3dln
3dln / flask-upload
Created May 27, 2019 12:56 — forked from dAnjou/flask-upload
Flask upload example
<VirtualHost *>
ServerName example.com
WSGIDaemonProcess www user=max group=max threads=5
WSGIScriptAlias / /home/max/Projekte/flask-upload/flask-upload.wsgi
<Directory /home/max/Projekte/flask-upload>
WSGIProcessGroup www
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
@3dln
3dln / express-boilerplate.js
Last active June 24, 2020 05:39
basic express boilerplate
const express = require('express')
const volleyball = require('volleyball')
const app = express()
app.use(volleyball)
app.get('/', (req, res) => {
res.json({
message: '🦄 Hello World! 🦄',
@3dln
3dln / index.html
Created October 12, 2020 08:31
virgool - webpack 5 - tut 01
<!doctype html>
<html>
<head>
<title>Webpack 5 tutorial</title>
<script src="https://unpkg.com/lodash@4.16.6"></script>
</head>
<body>
<script src="./src/index.js"></script>
</body>
</html>
@3dln
3dln / index.js
Last active October 13, 2020 06:15
virgool - webpack 5 - tut 02
function component() {
const element = document.createElement('div')
element.innerHTML = _.join(['Hello', 'Webpack'], ' ')
return element
}
document.body.append(component())
@3dln
3dln / webpack.config.js
Last active October 14, 2020 07:54
virgool webpack tutorial 3-1
const path = require('path');
module.exports = {
entry: './source/app.js',
output: {
filename: 'app.bundle.js',
path: path.resolve(__dirname, 'build'),
}
};