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
| import ctypes | |
| from ctypes import wintypes | |
| kernel32 = ctypes.WinDLL('kernel32', use_last_error=True) | |
| user32 = ctypes.WinDLL('user32', use_last_error=True) | |
| FLASHW_STOP = 0 | |
| FLASHW_CAPTION = 0x00000001 | |
| FLASHW_TRAY = 0x00000002 | |
| FLASHW_ALL = 0x00000003 |
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 mutagen.flac import FLAC | |
| import os | |
| for root, dirs, files in os.walk(u"."): | |
| for filename in files: | |
| if filename.endswith(".flac"): | |
| full_path = os.path.join(root, filename) | |
| audio = FLAC(full_path) | |
| title_list = audio.get("title", []) |
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
| s = s.replace('"', '″') | |
| s = s.replace('<', '<') | |
| s = s.replace('>', '>') | |
| s = s.replace('*', '*') | |
| s = s.replace('?', '︖') | |
| s = s.replace(':', 'ː') | |
| s = s.replace('/', '/') | |
| s = s.replace('\\', '∖') |
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
| public static Transform FindRecursive(this Transform self, string exactName) => self.FindRecursive(child => child.name == exactName); | |
| public static Transform FindRecursive(this Transform self, Func<Transform, bool> selector) | |
| { | |
| foreach (Transform child in self) | |
| { | |
| if (selector(child)) | |
| { | |
| return child; | |
| } |
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
| if (Input.GetMouseButton(0) && weaponPreviewRectTransform.isMouseOverUI()) | |
| { | |
| mPosDelta = Input.mousePosition - mPrevPos; | |
| if (Vector3.Dot(weaponModel.transform.up, Vector3.up) >= 0) | |
| { | |
| weaponModel.transform.Rotate(weaponModel.transform.up, -Vector3.Dot(mPosDelta, Camera.main.transform.right), Space.World); | |
| } | |
| else | |
| { | |
| weaponModel.transform.Rotate(weaponModel.transform.up, Vector3.Dot(mPosDelta, Camera.main.transform.right), Space.World); |
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 UnityEngine.UI; | |
| public class whatever : MonoBehaviour | |
| { | |
| private void Update() | |
| { | |
| Rect position = this.gameObject.GetComponent<RectTransform>().GetGlobalPosition(); | |
| if (position.Contains(Input.mousePosition)) Debug.Log("Yes, it is"); |
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 System.Collections; | |
| public class LightFlickering : MonoBehaviour { | |
| public Light lightSource; | |
| public float flickerInterval = 0.01f; // Time interval between flickers in seconds | |
| public float flickerDuration = 3f; // Duration of each flicker in seconds | |
| void OnEnable() | |
| { |
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
| function var_dump_pre($mixed = null) { | |
| echo '<pre>'; | |
| var_dump($mixed); | |
| echo '</pre>'; | |
| return null; | |
| } |
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
| function ToCamelCase($string){ | |
| // Max durability -> maxDurability | |
| $words = explode(' ',strtolower($string)); | |
| $humps = array_slice($words, 1); | |
| $humps = array_map('ucfirst', $humps); | |
| array_unshift($humps , $words[0]); | |
| return implode($humps); | |
| } | |
| echo ToCamelCase('Max durability'); |
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
| Bounds _combinedBounds = new Bounds(); | |
| Renderer[] renderers = weaponMount.GetComponentsInChildren<Renderer>(); | |
| if (renderers.Length > 0) | |
| { | |
| _combinedBounds = (renderers[0].bounds); | |
| for (int i = 1, len = renderers.Length; i < len; i++) | |
| { | |
| _combinedBounds.Encapsulate(renderers[i].bounds); | |
| } | |
| } |