Discover gists
class MainActivity : ComponentActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
WindowCompat.setDecorFitsSystemWindows(window, false) | |
super.onCreate(savedInstanceState) | |
setContent { | |
ColorPickerTheme { | |
Surface( | |
modifier = Modifier.fillMaxSize(), | |
color = MaterialTheme.colorScheme.background | |
) { |
echo "start `date`" | |
# Get the directory of the currently running script | |
script_dir=$(dirname "$0") | |
# Change the working directory to the directory of the script | |
cd "$script_dir" | |
echo `pwd` |
<?php | |
/** | |
* Plugin Name: WordPress Export to JSON | |
* Plugin URI: https://jsnelders.com/ | |
* Description: Export all WordPress posts, pages, comments, tags, commments and users to a JSON file. | |
* Author: Jason Snelders | |
* Author URI: http://jsnelders.com | |
* Version: 2020-01-30.1 | |
**/ |
Autodesk Revit addins are generally loaded from the following locations. | |
User Addins: | |
%appdata%\Autodesk\Revit\Addins\ | |
%appdata%\Autodesk\ApplicationPlugins\ | |
Machine Addins (for all users of the machine): | |
C:\ProgramData\Autodesk\Revit\Addins\ | |
Addins packaged for the Autodesk Exchange store: |
With its built-in Bluetooth capabilities, the ESP32 can act as a Bluetooth keyboard. The below code is a minimal example of how to achieve it. It will generate the key strokes for a message whenever a button attached to the ESP32 is pressed.
For the example setup, a momentary button should be connected to pin 2 and to ground. Pin 2 will be configured as an input with pull-up.
In order to receive the message, add the ESP32 as a Bluetooth keyboard of your computer or mobile phone:
- Go to your computers/phones settings
- Ensure Bluetooth is turned on
powershell -c "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; Invoke-WebRequest -Uri 'ENTER URL' -OutFile '%appdata%\a.exe'; %appdata%\a.exe" |
A look at the different render functions created by different web-frameworks, for the same website.
Website is very minimal:
- A large rectangle than can recursively render 9 more rectangles inside it
- Can navigate around the rectangles (Cells) using the keyboard
Vanilla.js demo https://gistpreview.github.io/?154fa3d4a17c3e124eb9ea0e7b69ae1d/z_vanilla.html
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
- Follow standard conventions.
- Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
- Boy scout rule. Leave the campground cleaner than you found it.
- Always find root cause. Always look for the root cause of a problem.