Skip to content

Instantly share code, notes, and snippets.

View ahmadnaser's full-sized avatar

Ahmad Naser ahmadnaser

View GitHub Profile
@ahmadnaser
ahmadnaser / ! .gitignore
Created September 9, 2023 18:28 — forked from dphurley/! .gitignore
! .gitignore for Express app
# Logs
logs
*.log
# Runtime data
pids
*.pid
*.seed
# Directory for instrumented libs generated by jscoverage/JSCover
rewrite ^(.*)$ /public/$1 break;
location / {
index index.php index.html;
try_files $uri $uri/ /index.php?$args;
}
@ahmadnaser
ahmadnaser / JS and jQuery learning resources
Created February 19, 2019 19:01 — forked from esergueev/JS and jQuery learning resources
JS and jQuery learning resources
JavaScript learning resources.
Starting point for those, who have already learned JS, but forgotten. Good article. Quite compact.
https://developer.mozilla.org/en/JavaScript/A_re-introduction_to_JavaScript
Question: what's the best learning source on JS. Some answers.
http://stackoverflow.com/questions/11246/best-resources-to-learn-javascript
http://stackoverflow.com/questions/2687566/learning-javascript-in-one-weekend
http://net.tutsplus.com/tutorials/javascript-ajax/the-best-way-to-learn-javascript/
in the end </head> of template folder, go to the selected theme index.php and apply following code
///Developed By Ahmad Naser Turnkey Solutions LLC - Greenbackend.com
///http://greenbackend.com/developer-hosting
///www.greenbackend.com
// www.khottah.com
///greenbackend@ahmadnaser.com
///copyright © 2018 ANTS LLC. All rights reserved.
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using UnityEngine.SceneManagement;
public class LoadingScreenManager : MonoBehaviour {
[Header("Loading Visuals")]
public Image loadingIcon;
public Image loadingDoneIcon;
//Shared on Ahmad Naser.com
func PlayAudioInSwift3() {
var player = AVAudioPlayer()
let audioPath = Bundle.main().pathForResource("2-loader", ofType: "mp3")
@ahmadnaser
ahmadnaser / gist:43f1520faa295162a5f7f6120177ca12
Last active October 14, 2016 18:59
Timer In C# and Unity
using UnityEngine;
using System.Collections;
/// <summary>
/// Descending Timer.
/// </summary>
public class Timer : MonoBehaviour
{
public string startTime = "";
public float delayTime = 1;
public void ActivateOptionsMenu(){
RectTransform Canvas = GameObject.Find ("OptionsCanvas").GetComponent<RectTransform> ();
if (Canvas != null) {
RectTransform[] recs = Canvas.GetComponentsInChildren<RectTransform> (true);
int Count = 0;
int NumOfElements = 2;
foreach (RectTransform r in recs) {
if (r.gameObject.name == "Overly") {
@ahmadnaser
ahmadnaser / SingletonService In Unity
Created October 8, 2016 18:42
Create single instance in unity
using UnityEngine;
using System;
using System.Collections.Generic;
public static class SingletonService {
private static Dictionary<Type, object> _singletons = new Dictionary<Type, object>();
//Adds a singleton to the manager
public static void RegisterSingletonInstance<T>(T instance) where T : class {
@ahmadnaser
ahmadnaser / Bootstrap Default Template By AhmadNaser
Created April 19, 2016 23:11
Bootstrap Default Template By AhmadNaser
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Bootstrap Template By AhmadNaser</title>
<!-- Bootstrap -->