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
| bl_info = { | |
| "name": "Match Area Light", | |
| "author": "Anthony Aragues", | |
| "version": (1, 2), | |
| "blender": (2, 90, 0), | |
| "location": "n > Lights", | |
| "description": "Rapidly create area lights to match size and orientation of selected faces", | |
| "warning": "", | |
| "doc_url": "", | |
| "category": "Lighting", |
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
| /** | |
| * dont know if value will be an ovject or a single value, so need to reutrn based on which | |
| * simply call with the top level value to start the recursive rows { fnFormatValue(v) } | |
| * @param {*} v | |
| */ | |
| const fnFormatValue=function(v){ | |
| if(Config.debug){ console.log('fnFormatValue',v,typeof v); } | |
| if(v){ | |
| let strType=typeof v; | |
| switch(strType){ |
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
| /** | |
| * | |
| * allows for setting properties deep within comlex json that has mixed arrays + objects | |
| * | |
| * fnCrawlProperty(['parentproperty',1,'childproperty in obj of array 1'],'somevalue',targetObject,'action') | |
| var objUpdate = fnCrawlProperty(arrMap,v,objTmpP,strAction); | |
| * the i is for recursive pruposes, dont need to specify when calling it | |
| * | |
| * @param {array} arrMap | |
| * @param {*} v |
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
| # https://kubernetes.io/docs/reference/kubectl/cheatsheet/ | |
| # see what nodes are running | |
| kubectl get nodes | |
| # see what is running | |
| kubectl get pods | |
| kubectl get services | |
| kubectl get pvc | |
| kubectl get secrets |
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
| // this was done on golang "net/http" to solve development environment issues and CORS security in browsers | |
| //put this function before your handlers | |
| func addCors(w *http.ResponseWriter, r *http.Request) { | |
| (*w).Header().Add("Access-Control-Allow-Origin", "*") | |
| (*w).Header().Add("Access-Control-Allow-Methods", "POST, GET, OPTIONS") | |
| (*w).Header().Add("Access-Control-Allow-Headers", "Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With") | |
| if r.Method == "OPTIONS" { |
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
| # --kill everything | |
| sudo docker stop $(sudo docker ps -a -q) | |
| sudo docker rm $(sudo docker ps -a -q) | |
| sudo docker volume prune | |
| sudo docker network prune |
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
| int intTotal = 0; | |
| int intMissed = 0; | |
| for (int i = 0; i < 2; ++i) { | |
| for (int ii = 0; ii < 9; ++ii) { | |
| String strField = 'Private.Network.EthSwitch'+ i + '.Port'+ ii+ '.RxBytes'; | |
| if (!doc.containsKey(strField) || doc[strField].empty){ | |
| intMissed += 1; | |
| }else{ | |
| intTotal += doc[strField].value; | |
| } |
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
| <div style={{"background":'linear-gradient(90deg, #f00 70%, transparent 30%)'}}> {objV.label} </div> |
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
| //add data to the array like this | |
| $scope.chartData=[{x:0,y:0}]; | |
| $scope.chartOptions = { | |
| "chart": { | |
| "type": 'linePlusBarChart', | |
| //...the other options... | |
| "callback": function(chart){ | |
| chart.dispatch.on( 'brush', function (objBrush) { | |
| // objBrush.extent these are array index values! |
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
| //this is a modified electron-forge default main.js file | |
| import { app, BrowserWindow, ipcMain, shell, protocol, dialog, session, clipboard, Menu } from 'electron'; | |
| const metastream = require('metastream'); | |
| // Keep a global reference of the window object, if you don't, the window will | |
| // be closed automatically when the JavaScript object is garbage collected. | |
| let mainWindow; | |
| process.on('uncaughtException', (err) => { console.error(err); }); | |
| const createWindow = () => { |