Skip to content

Instantly share code, notes, and snippets.

View yunhan0's full-sized avatar
:octocat:
Creating

Yunhan Li yunhan0

:octocat:
Creating
View GitHub Profile
using UnityEngine;
using System.Collections;
using System;
public class ButtonPress : MonoBehaviour
{
public bool lockX;
public bool lockY;
public bool lockZ;
@Elideb
Elideb / ChangePCStore.cs
Last active September 26, 2021 11:23
Generating builds from scripts in Unity
#if UNITY_STANDALONE && !STEAM_BUILD
[MenuItem("Build/Switch to Steam")]
#endif
public static void SwitchToSteam() {
string defines = PlayerSettings.GetScriptingDefineSymbolsForGroup(BuildTargetGroup.Standalone);
defines = AddCompilerDefines(defines, "STEAM_BUILD");
defines = RemoveCompilerDefines(defines, "GOG_BUILD");
UnityEngine.Debug.Log("Compiling with DEFINE: '" + defines + "'");
PlayerSettings.SetScriptingDefineSymbolsForGroup(BuildTargetGroup.Standalone, defines);
@thestonefox
thestonefox / ViveCursor.cs
Last active June 5, 2019 20:54
A basic implementation of a laser pointer for the HTC Vive controllers in Unity3D
using UnityEngine;
using System.Collections;
public class ViveCursor : MonoBehaviour {
public enum AxisType
{
XAxis,
ZAxis
}
@eventhough
eventhough / Uploader.jsx
Last active January 14, 2019 12:25
React component for handling S3 file upload
var React = require('react');
var Dropzone = require('react-dropzone');
var axios = require('axios');
exports = module.exports = React.createClass({
_onDrop: function (files) {
var file = files[0];
axios.get(ENDPOINT_TO_GET_SIGNED_URL, {
filename: file.name,
@stramit
stramit / PointerInputModule.cs
Last active October 18, 2018 05:25
Beta 19
using System.Collections.Generic;
using System.Text;
namespace UnityEngine.EventSystems
{
public abstract class PointerInputModule : BaseInputModule
{
public const int kMouseId = -1;
public const int kFakeTouchesId = -2;
@soheilhy
soheilhy / nginxproxy.md
Last active May 16, 2024 08:59
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@plentz
plentz / nginx.conf
Last active June 11, 2024 06:55
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048

Moved

Now located at https://github.com/JeffPaine/beautiful_idiomatic_python.

Why it was moved

Github gists don't support Pull Requests or any notifications, which made it impossible for me to maintain this (surprisingly popular) gist with fixes, respond to comments and so on. In the interest of maintaining the quality of this resource for others, I've moved it to a proper repo. Cheers!

@dergachev
dergachev / GIF-Screencast-OSX.md
Last active June 5, 2024 22:16
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application: