Skip to content

Instantly share code, notes, and snippets.

@Marwan0
Marwan0 / odoo-enterprise-install-custom.sh
Created April 8, 2026 23:32 — forked from tejastank/odoo-enterprise-install-custom.sh
Once install community odoo 16, then you can run this to install enterprise edition
#!/bin/bash
################################################################################
# Author: Tejaskumar Tank
#-------------------------------------------------------------------------------
# This script will install Odoo on your Ubuntu server. It can install multiple Odoo instances
# in one Ubuntu because of the different xmlrpc_ports
#-------------------------------------------------------------------------------
# Make a new file:
# sudo nano odoo-install.sh
# Place this content in it and then make the file executable:
@Marwan0
Marwan0 / TextToTextMeshPro.CS
Created August 19, 2021 11:43
Convert text component to TextMeshPro
using UnityEngine;
using UnityEditor;
using UnityEngine.UI;
using TMPro;
#if (UNITY_EDITOR)
public class TextToTextMeshPro : Editor
{
public class TextMeshProSettings
{
public bool Enabled;
@Marwan0
Marwan0 / PseudoRandomBoolean.cs
Created May 21, 2021 13:26 — forked from Fonserbc/PseudoRandomBoolean.cs
A boolean, written for use in Unity3D, that evaluates to true pseudo-randomly. Given a *baseProbability* from 0 to 1, it follows a Pseudo-Random Distribution inspired by http://wiki.teamliquid.net/dota2/Pseudo_Random_Distribution Every time it evaluates false, it increases the probability to evaluate true.
using UnityEngine;
using System;
/**
* Source at https://gist.github.com/Fonserbc/d061905a48555e583edc
* Made by @fonserbc
* Inspired by Valve's PRNG in use in Dota 2
*/
public class PseudoRandomBoolean {
@Marwan0
Marwan0 / fast_spheres.txt
Created March 2, 2018 15:46 — forked from sebbbi/fast_spheres.txt
Fast way to render lots of spheres
Setup:
1. Index buffer containing N quads (each 2 triangles), where N is the max amount of spheres. Repeating pattern of {0,1,2,1,3,2} + K*4.
2. No vertex buffer.
Render N*2 triangles, where N is the number of spheres you have.
Vertex shader:
1. Sphere index = N/4 (N = SV_VertexId)
2. Quad coord: Q = float2(N%2, (N%4)/2) * 2.0 - 1.0
3. Transform sphere center -> pos
@Marwan0
Marwan0 / EasingFunctions.cs
Created February 15, 2018 11:47 — forked from cjddmut/EasingFunctions.cs
Easing Functions for Unity3D
using UnityEngine;
/*
* Created by C.J. Kimberlin (http://cjkimberlin.com)
*
* The MIT License (MIT)
*
* Copyright (c) 2015
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
@Marwan0
Marwan0 / FGlowShader.cs
Created September 19, 2016 03:45 — forked from jpsarda/FGlowShader.cs
A Glow CG shader for Futile (Unity 3D)
public class FGlowShader : FShader
{
private float _glowAmount;
private Color _glowColor;
public FGlowShader(float glowAmount,Color glowColor) : base("GlowShader", Shader.Find("Futile/Glow"))
{
_glowAmount = glowAmount;
_glowColor = glowColor;
needsApply = true;
public static void ShowToast(string text)
{
if (Application.platform == RuntimePlatform.Android)
{
AndroidJavaClass unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
AndroidJavaObject activity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity");
activity.Call("runOnUiThread", new AndroidJavaRunnable(
()=>
{
@Marwan0
Marwan0 / FBSucks.cs
Created May 4, 2016 10:44 — forked from Borod4r/FBSucks.cs
Share image with text on android (works with FB)
private static void ShareImageWithTextOnAndroid(string message, string imageFilePath)
{
AndroidJavaClass intentClass = new AndroidJavaClass("android.content.Intent");
AndroidJavaObject intentObject = new AndroidJavaObject("android.content.Intent");
intentObject.Call<AndroidJavaObject>("setAction", intentClass.GetStatic<string>("ACTION_SEND"));
AndroidJavaClass uriClass = new AndroidJavaClass("android.net.Uri");
AndroidJavaObject uriObject = uriClass.CallStatic<AndroidJavaObject>("parse", "file://" + imageFilePath);
intentObject.Call<AndroidJavaObject>("putExtra", intentClass.GetStatic<string>("EXTRA_STREAM"), uriObject);
intentObject.Call<AndroidJavaObject>("putExtra", intentClass.GetStatic<string>("EXTRA_TEXT"), message);