This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'), | |
form = require('connect-form'), | |
fs = require('fs'), | |
util = require('util'); | |
var app = express.createServer( | |
form({keepExtensions: true}) | |
); | |
// switch between development and production like this: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_primes(n) : | |
# 2 is the smallest prime. Declaring it here cleans up the algorithm | |
primes = [2]; | |
# Start calulating primes at 3 | |
prime_count = 3; | |
while prime_count <= n: | |
# can it be divided by | |
to_be_divided_by = prime_count - 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Suppose you've been working on a local repo and now wish to host it on GitHub, GitLab, Azure DevOps etc. | |
# These git commands will enable you to do so whilst keeping history intact | |
# 1. Use the GitHub/GitLab/DevOps web interface to create the repo. | |
# Copy the URL to the repo (https option). | |
# 2. In your repo, add it as a remote | |
git remote add origin <REMOTE_URL> | |
# 3. Push your changes to the remote repo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This guide shows how you can you use icon fonts in TextMeshPro | |
1. Copy the font file (.ttf) and copy it a location inside your Unity assets folder. I found my font file here: C:\Windows\Fonts\SegoeIcons.ttf | |
2. In Unity, navigate to: | |
Window > TextMeshPro > Font Asset Creator | |
Select the font file you just copied to your project in "Source Font File" | |
3. Find the Unicode representation of your icon, these can be found on this website, for example: https://docs.microsoft.com/en-us/windows/apps/design/style/segoe-ui-symbol-font | |
Enter this Unicode to in to the text area labelled "Character Sequence (Hex). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.XR.ARFoundation; | |
using UnityEngine.XR.ARSubsystems; | |
/// <summary> | |
/// Component for placing a target gameobject on a plane. Raycasts from the center of the screen. | |
/// </summary> | |
public class ARPlanePlacement : MonoBehaviour | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEngine.XR.ARFoundation; | |
/// <summary> | |
/// A Unity component for using ARFoundation's Light Estimation feature to modify | |
/// the main light in our scene | |
/// </summary> | |
public class LightEstimation : MonoBehaviour | |
{ | |
[SerializeField] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://gist.github.com/FreyaHolmer/650ecd551562352120445513efa1d952 | |
using UnityEngine; | |
[RequireComponent(typeof(Camera))] | |
public class FlyCamera : MonoBehaviour | |
{ | |
public float acceleration = 50; // how fast you accelerate | |
public float accSprintMultiplier = 4; // how much faster you go when "sprinting" | |
public float lookSensitivity = 1; // mouse look sensitivity |