Skip to content

Instantly share code, notes, and snippets.

View JDamour's full-sized avatar
💬
Don't talk, show me the codes

MPATSWENIMANA J D'amour JDamour

💬
Don't talk, show me the codes
View GitHub Profile
@JDamour
JDamour / ObjectShake.cs
Created December 12, 2020 22:57 — forked from GuilleUCM/ObjectShake.cs
Unity:Animation:Shake object vibrate
using UnityEngine;
using System.Collections;
/// http://www.mikedoesweb.com/2012/camera-shake-in-unity/
public class ObjectShake : MonoBehaviour {
private Vector3 originPosition;
private Quaternion originRotation;
public float shake_decay = 0.002f;
@JDamour
JDamour / README.md
Created November 30, 2020 07:53 — forked from JohannesDeml/README.md
Remove Unity Mobile Notification Warning for WebGL builds

Remove warning

Unity has a warning when running a webgl build on mobile (iOS, Android). In order to remove it, just add this file to an editor folder.

Logic

The script will run after the build has completed and replace the checks from all generated javascript files.

Support

  • Tested with Unity 2019.3, but should work with any version
  • Works with Name Files as Hashes, since it looks for all js files in the Build folder
  • Only runs when building for WebGL, so you can use it for a multiplatform project
using UnityEngine;
/// <summary>
/// Responsive Camera Scaler
/// </summary>
public class CameraAspectRatioScaler : MonoBehaviour {
/// <summary>
/// Reference Resolution like 1920x1080
/// </summary>
@JDamour
JDamour / auth.php
Created August 13, 2018 10:46 — forked from woganmay/auth.php
PHP CURL code to authenticate with Flarum API
<?php
// Details to access Flarum
$api_url = "https://my.forum.url/api/token";
$username = "my_flarum_user";
$password = "my_flarum_pass";
// CURL call
$ch = curl_init($api_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
@JDamour
JDamour / Super simple background image slideshow.css
Created July 31, 2018 10:06 — forked from mhulse/Super simple background image slideshow.css
Super simple jQuery background-image random slideshow (using CSS3 for the transition and gets the image paths via HTML5 `data` attribute).
[data-slides] {
background-image: url(../../uploads/banner1.jpg); /* Default image. */
background-repeat: no-repeat;
background-position: center top;
background-size: cover;
transition: background-image 1s linear;
}
/* Use additional CSS to control the `height` of `[data-slides]`, like so: */
@JDamour
JDamour / ReadMe.txt
Created May 23, 2018 17:34 — forked from zeuxisoo/ReadMe.txt
Simple upload and resize image on PHP
- attachment
- 1.jpg
- 2.jpg
...
...
...
- index.php
- resize_image.php
- uploader.php
@JDamour
JDamour / encrypt-decrypt.php
Created February 12, 2018 18:58 — forked from richjenks/encrypt-decrypt.php
Simple PHP Encryption & Decryption
<?php
/**
* Simple PHP Encryption functions
*
* Attempts to be as secure as possible given:
*
* - Key can be any string
* - No knowledge of encryption is required
* - Only key and raw/encrypted string is needed at each end
@JDamour
JDamour / openssl_encrypt_decrypt.php
Created February 12, 2018 18:57 — forked from joashp/openssl_encrypt_decrypt.php
Simple PHP encrypt and decrypt using OpenSSL
<?php
/**
* simple method to encrypt or decrypt a plain text string
* initialization vector(IV) has to be the same when encrypting and decrypting
*
* @param string $action: can be 'encrypt' or 'decrypt'
* @param string $string: string to encrypt or decrypt
*
* @return string
*/
@JDamour
JDamour / ubuntu-server-setup-16.04-LAMP.md
Created November 28, 2017 18:06 — forked from Otienoh/ubuntu-server-setup-16.04-LAMP.md
LAMP Server setup for Ubuntu 16.04 on Digital Ocean

Server setup for Ubuntu 16.04 on Digital Ocean

The setup installs the following software:

The setup installs the following software:

  • Apache
  • MySQL
  • PHP
  • Node
@JDamour
JDamour / Laravel PHP7 LEMP AWS.md
Created November 28, 2017 17:33 — forked from santoshachari/Laravel PHP7 LEMP AWS.md
Laravel 5.x on Ubuntu 16.x, PHP 7.x, Nginx 1.9.x

#Steps to install latest Laravel, LEMP on AWS Ubuntu 16.4 version. This tutorial is the improvised verision of this tutorial on Digitalocean based on my experience.

Install PHP 7 on Ubuntu

Run the following commands in sequence.

sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install zip unzip