Skip to content

Instantly share code, notes, and snippets.

View ohir's full-sized avatar

OHIR-RIPE ohir

  • private contractor
  • Poland
View GitHub Profile
@ohir
ohir / main.dart
Last active April 16, 2018 15:52
mini-max-sum in Dart
String minMax(String s) {
int sumA, min4, max4;
List<int> l;
try {
l = s.split(' ').map((String s) => int.parse(s)).toList();
if (l.length != 5 || l.any((e) => e < 1 || e > 1000000000))
throw 'Five integers in 1..10^9 range expected!';
} catch (e) {
throw 'Input error: $e';
}
@ohir
ohir / failSwOsInInspector.log
Created April 29, 2018 06:58
Basic example "counter" app crashed after "Toggle Platform Mode" in FlutterInspector panel.
Launching lib/main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...
Resolving dependencies...
Running 'gradlew assembleDebug'...
Built build/app/outputs/apk/debug/app-debug.apk (30.8MB).
Installing build/app/outputs/apk/app.apk...
I/FlutterActivityDelegate(31062): onResume setting current activity to this
D/ (31062): HostConnection::get() New Host Connection established 0xad13a1c0, tid 31085
D/EGL_emulation(31062): eglMakeCurrent: 0xaa9b2740: ver 2 0 (tinfo 0xb3fed170)
Syncing files to device Android SDK built for x86...
@ohir
ohir / macapp.go
Created May 26, 2018 11:55 — forked from mholt/macapp.go
Distribute your Go program (or any single binary) as a native macOS application
// Package main is a sample macOS-app-bundling program to demonstrate how to
// automate the process described in this tutorial:
//
// https://medium.com/@mattholt/packaging-a-go-application-for-macos-f7084b00f6b5
//
// Bundling the .app is the first thing it does, and creating the DMG is the
// second. Making the DMG is optional, and is only done if you provide
// the template DMG file, which you have to create beforehand.
//
// Example use:
//lint:file-ignore U1000 silence!
package main
import "fmt"
const (
b6m = 63
b4m = 15
)
Related: https://github.com/go-delve/delve/issues/2985
curscan.go:97 0x1153afe 0f93442431 setnb byte ptr [rsp+0x31]
curscan.go:98 0x1153b03 8b74243c mov esi, dword ptr [rsp+0x3c]
curscan.go:98 0x1153b07 c1ee10 shr esi, 0x10
curscan.go:98 0x1153b0a 81fe9ff00000 cmp esi, 0xf09f
curscan.go:98 0x1153b10 0f95442435 setnz byte ptr [rsp+0x35]
curscan.go:98 0x1153b15 7502 jnz 0x1153b19
curscan.go:98 0x1153b17 eb02 jmp 0x1153b1b
curscan.go:98 0x1153b19 eb20 jmp 0x1153b3b