Skip to content

Instantly share code, notes, and snippets.

View Krummelz's full-sized avatar

Jacques Dés Prés Krummelz

  • Durban, South Africa
View GitHub Profile
@erineccleston
erineccleston / OrthographicOverride.cs
Last active August 7, 2019 21:45
Allows 2D Pixel Perfect to work with Cinemachine
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>
@svet-b
svet-b / bigdashboard_output.pdf
Last active August 13, 2024 07:56
PDF export of Grafana dashboard using puppeteer
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@TLaborde
TLaborde / gist:22359e9029f3bc03872c208406d64d5d
Created April 12, 2016 07:38
Using powershell for "realtime" notification on a dashboard
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
@negue
negue / NinePatchGroup.js
Created March 1, 2014 01:23
Phaser NinePatchGroup
/**
* NinePatchGroup
*
* @author Negue
* @extends {Phaser.Group}
* @param game
* @constructor
*/
var NinePatchGroup = function (game, x, y, targetWidth, targetHeight, imageKey) {
Phaser.Group.call(this, game);
@kwokhou
kwokhou / angular-jsonDate.js
Last active March 1, 2016 08:33
AngularJS filter to format ASP.NET JSON Date
// 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)));
@WilbertOnGithub
WilbertOnGithub / gitconfig.cmd
Created April 17, 2012 08:43
Configure Git with P4Merge (Windows settings)
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
@lrvick
lrvick / bitcolor.js
Created March 18, 2012 20:02
Javascript functions for doing fast binary/hex/RGB color conversions using bitwise operations.
// 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){