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
| # --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
| // 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
| # 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
| /** | |
| * | |
| * 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
| /** | |
| * 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
| 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
| #example calling | |
| # arrVerts=[] | |
| # for objVert in objMesh.verts: | |
| # if objVert.select == True: | |
| # arrVerts.append(objVert) | |
| objScale= fnGetScale(arrVerts) | |
| print(objScale) | |
| def fnGetScale(arrVerts): |
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
| /*----====|| LIBRARY IMPORTS || ====----*/ | |
| //import React, { useContext,useEffect,useState } from 'react'; | |
| //import { Layout } from 'antd'; | |
| /*----====|| COPMPONENT IMPORTS || ====----*/ | |
| //import MyComponent from './components/myComponent.js'; | |
| /*----====|| CONTEXT || ====----*/ | |
| import {UserContext,ConfigContext} from '../context.js'; | |
| /*----====|| STYLE IMPORTS || ====----*/ |
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
| # List of common operations to run on imported objects like .stl | |
| # paste all or some into a script window in blender and run. | |
| # If there's any interest in seeing this in addon form somewhere let me know, it seemed too basic/common to be another addon to install. | |
| import bpy | |
| # resize objects imported that were unit=1mm and Blender is set at 1m | |
| bpy.ops.transform.resize(value=(0.001, 0.001, 0.001), orient_type='GLOBAL', orient_matrix=((1, 0, 0), (0, 1, 0), (0, 0, 1)), orient_matrix_type='GLOBAL', mirror=True, use_proportional_edit=False, proportional_edit_falloff='SMOOTH', proportional_size=1, use_proportional_connected=False, use_proportional_projected=False) | |
| # toggle to edit mode for a few things | |
| bpy.ops.object.editmode_toggle() |