This file contains hidden or 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 UnityEditor; | |
| using System.Collections; | |
| public class ColliderToFit : MonoBehaviour { | |
| [MenuItem("My Tools/BoxCollider/Fit to Children")] | |
| static void FitToChildren() { | |
| foreach (GameObject rootGameObject in Selection.gameObjects) { | |
| if (!(rootGameObject.collider is BoxCollider)) |
This file contains hidden or 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 UnityEditor; | |
| using UnityEditor.Experimental.AssetImporters; | |
| using UnityEngine; | |
| using System.Reflection; | |
| using System; | |
| using System.Collections; | |
| using System.Linq; | |
| using Object = UnityEngine.Object; | |
| using System.Collections.Generic; |
This file contains hidden or 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 someDate = new Date("Wed Jun 26 2019 09:08:32 GMT+0100") | |
| result = `${String(someDate.getHours()).padStart(2,"0")}:${String(someDate.getMinutes()).padStart(2,"0")}` // returns "09:08" |
This file contains hidden or 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
| adb logcat -s Unity ActivityManager PackageManager dalvikvm DEBUG |
This file contains hidden or 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
| // Arowx.com 2013 - free to use and improve! | |
| using UnityEngine; | |
| using System.Collections; | |
| public class JoystickTester : MonoBehaviour { | |
| public TextMesh joysticks; | |
| public TextMesh[] inputText; | |
| public TextMesh[] buttonText; |
This file contains hidden or 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
| lsof -n -i4TCP:8080 | grep LISTEN |
This file contains hidden or 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
| # example of threads working on a queue | |
| from Queue import Queue | |
| from threading import Thread | |
| num_worker_threads = 10 | |
| # items to work on | |
| def source(): | |
| return xrange(400) |
This file contains hidden or 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; | |
| namespace datagreed.input | |
| { | |
| /// <summary> | |
| /// Implements proper deadzones for joystick or gamepad sticks. | |
| /// Based on http://www.third-helix.com/2013/04/12/doing-thumbstick-dead-zones-right.html | |
| /// | |
| /// Example usage: | |
| /// |
This file contains hidden or 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
| from django.template import loader, Template, Context | |
| from rest_framework.filters import SearchFilter | |
| browsable_api_filter_template = """{% load i18n %} | |
| <h2>{{ title }}</h2> | |
| <p>{{description}}</p> | |
| <form class="form-inline"> | |
| <div class="form-group"> | |
| <div class="input-group"> |
This file contains hidden or 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
| {% load rest_framework %} | |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Swagger</title> | |
| <meta charset="utf-8"/> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <link rel="stylesheet" type="text/css" href="//unpkg.com/swagger-ui-dist@3/swagger-ui.css" /> | |
| <style> |