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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.4.24; | |
library SafeMath { | |
function mul(uint256 a, uint256 b) internal pure returns (uint256) { | |
if (a == 0) { | |
return 0; | |
} | |
uint256 c = a * b; |
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
git config --global http.postBuffer 1000000000 | |
git config --global lfs.activitytimeout 60 | |
git config --global http.version HTTP/1.1 | |
------------ | |
- Apparently, HTTP/2 setup is not very compatible with git large files. |
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
// SPDX-License-Identifier: MIT | |
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/ERC20.sol) | |
pragma solidity ^0.8.0; | |
import "./IERC20.sol"; | |
import "./extensions/IERC20Metadata.sol"; | |
import "../../utils/Context.sol"; | |
/** |
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
private IEnumerator PostRegistrationDetails(string jsonData) | |
{ | |
var raw = Encoding.UTF8.GetBytes(jsonData); | |
using UnityWebRequest webRequest = UnityWebRequest.Post(uriPostResults, "POST"); | |
webRequest.SetRequestHeader("Content-Type", "application/json"); | |
webRequest.uploadHandler = new UploadHandlerRaw(raw); | |
webRequest.uploadHandler.contentType = "application/json"; | |
webRequest.downloadHandler = new DownloadHandlerBuffer(); | |
webRequest.SendWebRequest(); | |
if (webRequest.isNetworkError || webRequest.isHttpError) |
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; | |
public class JoystickCameraController : MonoBehaviour | |
{ | |
public float joystickSensitivity = 0.1f; | |
public float rotationSpeed = 5f; | |
public float zoomSpeed = 2f; | |
private Vector2 joystickInput; | |
private Transform cameraTransform; |
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; | |
using System.Management; | |
namespace DeviceStatsLogger | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Console.WriteLine("Retrieving device stats..."); |
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
//demonstrates a static string being accessed and updated by multiple threads using a lock for synchronization: | |
using System; | |
using System.Threading; | |
public class Program | |
{ | |
// Static string variable | |
private static string sharedString = "Initial Value"; |
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; | |
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.UI; | |
public class CanvasItemScale : MonoBehaviour | |
{ | |
public CanvasScaler target; | |
public RectTransform targetTransform; |
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; | |
public class LinkRectTransforms : MonoBehaviour | |
{ | |
public RectTransform rectTransform1; | |
public RectTransform rectTransform2; | |
private void Update() | |
{ | |
// Get the current position of the right edge of RectTransform1 |
OlderNewer