Skip to content

Instantly share code, notes, and snippets.

@bistole
bistole / popupMenu.dart
Created March 17, 2021 20:22
popup menu
void popupMenu(BuildContext context, ReduxActions redux) {
GlobalKey gKey =
getViewResource().getGlobalKeyByName("PHOTO-LIST:" + widget.uuid);
Rect gridRect = getViewResource().getRectFromWidget(gKey);
Rect allRect = Offset.zero & Overlay.of(context).context.size;
List<PopupMenuEntry> items = [
PopupMenuItem<String>(
child: Text('Delete'),
@bistole
bistole / main.dart
Created March 17, 2021 20:18
get rect from rendered widget
Rect getRectFromWidget(GlobalKey gKey) {
final keyContext = gKey.currentContext;
if (keyContext != null) {
final box = keyContext.findRenderObject() as RenderBox;
final offset = box.localToGlobal(Offset.zero);
final size = box.hasSize ? box.size : Size.zero;
return Rect.fromLTWH(offset.dx, offset.dy, size.width, size.height);
}
return Rect.zero;
}
on: ["push"]
name: coveralls
jobs:
build:
name: build
runs-on: ubuntu-latest
steps:
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
name: npm-publish
on:
release:
types: [created]
jobs:
@bistole
bistole / build_dmg.sh
Created March 3, 2021 03:30
build dmg
# mount dmg
echo "Mount DMG..."
hdiutil attach ${TEMP_DMG_FILE} | tee ${LOG_FILE0}
DMG_UUID=`grep /Volumes/untitled ${LOG_FILE0} | awk '{print $2}'`
echo DMG UUID = ${DMG_UUID}
# rename dmg
echo "Rename DMG's olume name"
diskutil rename untitled Storyboard
@bistole
bistole / build_app.sh
Created March 2, 2021 21:11
archive, notarize and stapler
#!/bin/sh
CODE_BASE=/path/to/Storyboard
SCRIPT_PATH=$(dirname "$0")
DEPLOY_ROOT_PATH="${SCRIPT_PATH}/.."
LOG_PATH="${DEPLOY_ROOT_PATH}/logs"
BUILD_PATH="${DEPLOY_ROOT_PATH}/build/macos"
VERSION=
STATUS=
REQUEST_UUID=
@bistole
bistole / build.bat
Last active January 30, 2021 22:53
change cgo header for msvc
powershell -Command "(gc libBackend.h) -replace '__SIZE_TYPE__', 'size_t' | %%{$_ -replace 'typedef (.*) _Complex ', '//typedef $1 _Complex '} | out-file libBackend_msvc.h"
@bistole
bistole / libBackend.h
Created January 30, 2021 22:49
update header for msvc
//change __SIZE_TYPE__ to size_t -->
//typedef __SIZE_TYPE__ GoUintptr;
typedef size_t GoUintptr;
// comment out _Complex since it is not supported by msvc -->
//typedef float _Complex GoComplex64;
//typedef double _Complex GoComplex128;
@bistole
bistole / CMakeLists.txt
Created January 30, 2021 22:38
add backend sub dir to app
add_subdirectory("backend")
install(FILES "${BACKEND_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime)
@bistole
bistole / CMakeLists.txt
Created January 30, 2021 22:36
add libBackend.dll to app
set(BACKEND_LIBRARY "${CMAKE_CURRENT_SOURCE_DIR}/libBackend.dll")
set(BACKEND_LIBRARY ${BACKEND_LIBRARY} PARENT_SCOPE)