Skip to content

Instantly share code, notes, and snippets.

@Lightnet
Lightnet / getDB.js
Created November 12, 2021 02:33
reused instance for JavaScript in nodejs
// https://www.tutorialguruji.com/javascript/reusing-database-connections-with-azure-functions-using-javascript/amp/
// https://pretagteam.com/question/reusing-database-connections-with-azure-functions-using-javascript
class DBTest{
constructor(){
this.data="test";
}
setText(params) {
this.data=params;
}
@Lightnet
Lightnet / gulpfile.babel.js
Created October 20, 2021 16:58
gulp 4.0.2 auto reload server watch files
// base on this links
// https://gist.github.com/webdesserts/5632955
// need this for "gulp default" to run command line
// @babel/register
import { src, dest, watch, parallel, series } from "gulp";
import {spawn} from "child_process";
import config from'./config';
@Lightnet
Lightnet / CMakeLists.txt
Last active May 6, 2021 04:03
glfw3 vulkan c api
#================================================
# CMAKE BUILD
# WINDOW BUILD CURRENTLY
#================================================
cmake_minimum_required(VERSION 3.20) # FetchContent is available in 3.11+
#message("CMAKE_BUILD_TYPE >>> " ${CMAKE_BUILD_TYPE})
#convert checks for debug / release
if(CMAKE_BUILD_TYPE)
string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE)
endif()
@Lightnet
Lightnet / CMakeLists.txt
Created April 18, 2021 21:25
SDL 2 Project build test.
#================================================
# CMAKE BUILD
# WINDOW BUILD CURRENTLY
#================================================
cmake_minimum_required(VERSION 3.20) # FetchContent is available in 3.11+
message("CMAKE_BUILD_TYPE >>> " ${CMAKE_BUILD_TYPE})
#convert checks for deubug / release
string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE)
if(CMAKE_BUILD_TYPE STREQUAL "debug")
@Lightnet
Lightnet / gunjstrustsharekeyv3.js
Last active May 4, 2020 23:20
gunjstrustsharekeyv3
/*
Self contain Sandbox Gun Module chain for auth sea.js:
Created by: Lightnet
License: MIT
Version: 3.0
Last Update:2020.05.04
Credit: amark ( https://github.com/amark/gun)
Status(Work in progress!):
@Lightnet
Lightnet / mycustomtools.py
Created April 17, 2020 17:40
SImple rig and object rebuilds.
bl_info = {
"name": "Simple My Tools b28x",
"author":"Lightnet",
"version":(0,0,1),
"blender": (2,82,0),
"location": "Object",
"category": "Object",
"warning": "",
"wiki_url": "",
}
@Lightnet
Lightnet / blendercopyarmture.py
Last active April 13, 2020 19:34
blender armature copy bones to armature bone
import bpy
#source_rig = 'MBlab_sk'
#dest_rigs = ['Armature']
############
bone_data = {}
selectobjname = None
def edit_rig(rigname):
bpy.ops.object.mode_set(mode='OBJECT')
bpy.ops.object.select_all(action='DESELECT')
//===============================================
// CLEAR GUN DATABASE
localStorage.clear();
//(function() {
//===============================================
// INIT GUN DATABASE
let gunurl = window.location.origin+'/gun';
//console.log(gunurl);
var gun = Gun(gunurl);
gun.on('hi', peer => {//peer connect
@Lightnet
Lightnet / clientprototype.js
Last active September 26, 2019 06:00
gunjstrustsharekey.js
//===============================================
// CLEAR GUN DATABASE
localStorage.clear();
//(function() {
//===============================================
// INIT GUN DATABASE
let gunurl = window.location.origin+'/gun';
//console.log(gunurl);
var gun = Gun(gunurl);
gun.on('hi', peer => {//peer connect
@Lightnet
Lightnet / gunjstrustsharekey.js
Last active January 28, 2021 09:14
gunjstrustsharekeyv3
/*
Self contain Sandbox Gun Module chain for auth sea.js:
Created by: Lightnet
License: MIT
Version: 3.0
Last Update:2019.08.17
Credit: amark ( https://github.com/amark/gun)
Status(Work in progress!):