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 Cinemachine; | |
using UnityEngine; | |
using UnityEngine.U2D; | |
using System.Reflection; | |
/// <summary> | |
/// Add this component to a camera that has PixelPerfectCamera and CinemachineBrain | |
/// components to prevent the active CinemachineVirtualCamera from overwriting the | |
/// correct orthographic size as calculated by the PixelPerfectCamera. | |
/// </summary> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
As requested on reddit, here is some information about how i made a "realtime" dashboard. | |
Flow | |
=== | |
1. a task grab data with a scheduled job. It saves the data in json in two places: one static folder, which overwrite existing data, and in a temporary folder, to be a new "event". | |
2. a websocket deamon (websocketd) run a powershell script listening to changes in the temporary folder. When a change happens, the new data is read and sent thru the websocket | |
3. the frontend update the data with what came thru the websocket. If the browser does not support websocket, it will instead pull the data from time to time | |
Grabbing Data and saving as JSON |
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
/** | |
* NinePatchGroup | |
* | |
* @author Negue | |
* @extends {Phaser.Group} | |
* @param game | |
* @constructor | |
*/ | |
var NinePatchGroup = function (game, x, y, targetWidth, targetHeight, imageKey) { | |
Phaser.Group.call(this, game); |
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
// Format a /Date(XXXXXXXXXXXXXXXX)/ into a JSON date object. | |
angular.module('jsonDate', []).filter('jsonDate', function () { | |
return function (input, format) { | |
if (angular.isUndefined(input)) | |
return; | |
// first 6 character is the date | |
var date = new Date(parseInt(input.substr(6))); |
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
git config --global merge.tool p4merge | |
git config --global mergetool.p4merge.cmd "p4merge.exe \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\"" | |
git config --global diff.tool p4merge | |
git config --global difftool.p4merge.cmd "p4merge.exe \"$LOCAL\" \"$REMOTE\"" | |
git config --global mergetool.keepBackup false | |
git config --global mergetool.trustExitcode false | |
git config --global difftool.prompt false |
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
// convert 0..255 R,G,B values to binary string | |
RGBToBin = function(r,g,b){ | |
var bin = r << 16 | g << 8 | b; | |
return (function(h){ | |
return new Array(25-h.length).join("0")+h | |
})(bin.toString(2)) | |
} | |
// convert 0..255 R,G,B values to a hexidecimal color string | |
RGBToHex = function(r,g,b){ |