Skip to content

Instantly share code, notes, and snippets.

@comphonia
comphonia / WindowSwitcher.cs
Created August 8, 2019 20:22
Windows Switcher for Unity3d uses stack to navigate window panels by closing the previous gameobject and opening the new one passes as a reference.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class WindowSwitcher : MonoBehaviour
{
[Header("Main screen hud")]
public GameObject hud;
[Header("Parent gameobject for windows")]
public GameObject menuPanel;
@comphonia
comphonia / mongo-cheat-sheet.js
Created December 25, 2018 06:46 — forked from raineorshine/mongo-cheat-sheet.js
Cheat Sheet: MongoDB
/* COMMAND LINE */
mongod & // start mongo server on port 27017 by default
mongo mydb // launch mongo shell using the specified database
// importing & exporting
mongoimport -d mydb -c mycollection --jsonArray --file input.json
mongoimport -d mydb -c mycollection --headerline --type csv --file input.csv
mongoexport -d mydb -c mycollection --out output.json
mongoimport --db mydb --collection tours --jsonArray --file tours.json
@comphonia
comphonia / gist:71389de31a7ebddfcf27d038010c585b
Last active December 26, 2018 20:10
How to deploy an app to Heroku

Heroku is a hosted platform which lets you deploy apps from different languages; Python, Ruby, Node etc. It is a quick way to get your app

online without the hassle of setting up a server.

To get Started:

Install GIT

Install the Heroku Toolbelt

@comphonia
comphonia / preloader.txt
Created December 8, 2018 10:26
simple preloader
//HTML, include as 1st in body tag
<div class="loader">
<div class="spinner">
</div>
</div>
//CSS
.loader{
width: 100%;
@comphonia
comphonia / script.js
Created December 8, 2018 09:51 — forked from jbutko/script.js
jQuery: JQuery smooth scrolling when clicking an anchor link
$('a').click(function(){
$('html, body').animate({
scrollTop: $( $.attr(this, 'href') ).offset().top
}, 500);
return false;
});
// http://stackoverflow.com/questions/7717527/jquery-smooth-scrolling-when-clicking-an-anchor-link/7717572#7717572?newreg=16ca424bc4024b21a4fcc728ea6451d5
@comphonia
comphonia / npm-cheat-sheet.md
Created October 13, 2018 07:29 — forked from AvnerCohen/npm-cheat-sheet.md
Node.js - npm Cheat Sheet

Node.js - npm Cheat Sheet

(Full description and list of commands at - https://npmjs.org/doc/index.html)

##List of less common (however useful) NPM commands

######Prepand ./bin to your $PATH Make sure to export your local $PATH and prepand relative ./node_modules/.bin/:

using UnityEngine;
using UnityEditor;
public class ReplaceWithPrefab : EditorWindow
{
[SerializeField] private GameObject prefab;
[MenuItem("Tools/Replace With Prefab")]
static void CreateReplaceWithPrefab()
{