dart compile aot-snapshot dartfile.dart
perf record -g dartaotruntime dartfile.aot parameterfile.json
perf report
This file contains 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
/usr/libexec/PlistBuddy -c 'Print CFBundleIdentifier' /Applications/Visual\ Studio\ Code.app/Contents/Info.plist |
This file contains 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
defaults write com.apple.LaunchServices/com.apple.launchservices.secure LSHandlers -array-add '{ | |
LSHandlerContentType = "public.plain-text"; | |
LSHandlerRoleAll = "com.neovide.neovide"; | |
}' |
This file contains 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 code, take care | |
// https://github.com/dart-lang/sdk/issues/32874#issuecomment-1467905810 | |
class BufferingIOSink implements IOSink { | |
static const int _defaultBufferSize = 2048; | |
final Sink<List<int>> _sink; | |
Uint8List _buffer; | |
// Current live bytes in buffer. | |
int _start = 0; | |
int _end = 0; |
This file contains 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
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -dump | grep -B3 "bindings:.*:" |
This file contains 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
/// Traverse the list by the given path. | |
/// ex: listPath<int>([1, 2, [3, 4]], '2.1') => 4 | |
T? listPath<T>(Object list, String path) { | |
if (path.isEmpty) return null; | |
var result = list; | |
for (final part in path.split('.')) { | |
if (result is! List) return null; | |
final idx = int.tryParse(part); | |
if (idx == null || idx < 0 || result.length <= idx) return null; |
This file contains 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
#!/bin/bash | |
brew deps --installed --dot --graph | pbcopy | |
# And paste it in https://dreampuf.github.io/GraphvizOnline | |
# https://twitter.com/kevmoo/status/1612939071982297089 |
reference: https://antonz.org/json-virtual-columns/
select value from events
;
{"timestamp":"2022-05-15T09:31:00Z","object":"user","object_id":11,"action":"login","details":{"ip":"192.168.0.1"}}
{"timestamp":"2022-05-15T09:32:00Z","object":"account","object_id":12,"action":"deposit","details":{"amount":"1000","currency":"USD"}}
{"timestamp":"2022-05-15T09:33:00Z","object":"company","object_id":13,"action":"edit","details":{"fields":["address","phone"]}}
This file contains 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://stackoverflow.com/questions/55431496/font-awesome-spinners-icons-not-spinning-in-flutter | |
// | |
// Usage: | |
// Spinner( | |
// icon: FontAwesomeIcons.spinner, | |
// ) | |
// | |
class Spinner extends StatefulWidget { | |
final IconData icon; |
This file contains 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
# Rails controller concern to enable Devise authentication for ActiveStorage. | |
# Put it in +app/controllers/concerns/blob_authenticatable.rb+ and include it when overriding | |
# +ActiveStorage::BlobsController+ and +ActiveStorage::RepresentationsController+. | |
# | |
# Optional configuration: | |
# | |
# Set the model that includes devise's database_authenticatable. | |
# Defaults to Devise.default_scope which defaults to the first | |
# devise role declared in your routes (usually :user) | |
# |
NewerOlder