Skip to content

Instantly share code, notes, and snippets.

View zzwx's full-sized avatar
🗨️
Coding

zzwx

🗨️
Coding
View GitHub Profile
@zzwx
zzwx / Resolve_HIGH_DPI.ps1
Created February 20, 2022 16:32
Davinci Resolve Secondary Monitor with High DPI
cd "C:\Program Files\Blackmagic Design\DaVinci Resolve\"
$Env:QT_DEVICE_PIXEL_RATIO = 1
$Env:QT_AUTO_SCREEN_SCALE_FACTOR = 1
.\Resolve.exe
@zzwx
zzwx / Command Prompt
Created February 10, 2022 10:36
Open Windows Terminal @ current working directory (like code .)
wt -d %CD%
@zzwx
zzwx / Script.py
Created November 25, 2021 21:51
Global coordinates of selected vertices in Blender
import bpy
import bmesh
obj=bpy.context.object
if obj.mode == 'EDIT':
bm=bmesh.from_edit_mesh(obj.data)
for v in bm.verts:
if v.select:
# Local
# print(v.co)
@zzwx
zzwx / main.dart
Created July 21, 2021 21:40
Dart (2.13.4 with null safety) call() and apply()
class Adder implements Function {
int call(int a, int b) => a + b;
}
class Incrementer implements Function {
int _amt;
Incrementer(this._amt);
int call(int a) => a + _amt;
}
@zzwx
zzwx / main.dart
Created June 21, 2021 23:21
Flutter Stack with Positioned and clipBehavior: Clip.none
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
debugShowCheckedModeBanner: false,
@zzwx
zzwx / main.dart
Created June 16, 2021 10:37
Trick for lazy loading in both directions in Flutter
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
/// This Widget is the main application widget.
class MyApp extends StatelessWidget {
static const String _title = 'Flutter Code Sample';
@override
Widget build(BuildContext context) {
@zzwx
zzwx / gist:b76f26100b077003dacae8f124cbdcad
Created March 15, 2021 15:13
Which version go command app was compiled with (Windows)
for /f %i in ('where gopls') do go version %i
@zzwx
zzwx / git-credential-helper-libsecret.sh
Created November 26, 2020 19:20 — forked from P403n1x87/git-credential-helper-libsecret.sh
Store git credentials securely on Ubuntu
#!/bin/bash
set -e
sudo apt-get -y install libsecret-1-0 libsecret-1-dev libglib2.0-dev
sudo make --directory=/usr/share/doc/git/contrib/credential/libsecret
git config --global credential.helper /usr/share/doc/git/contrib/credential/libsecret/git-credential-libsecret
@zzwx
zzwx / example.go
Created September 23, 2020 13:45
Call C from Go
package main
/*
#include <stdio.h>
#include <stdlib.h>
void print_hello(const char *name) {
printf("Hello........... %s!\n", name);
}
*/
import "C"
@zzwx
zzwx / main.go
Last active October 17, 2019 16:28
Appending to nil and empty slice https://play.golang.org/p/wRP9p1zmetf
var nilSlice []string
if nilSlice == nil {
fmt.Printf("nilSlice is nil\n")
} else {
fmt.Printf("nilSlice is NOT nil\n")
}
var notNilSlice []string = []string{}