Skip to content

Instantly share code, notes, and snippets.

View osa1's full-sized avatar

Ömer Sinan Ağacan osa1

View GitHub Profile
@osa1
osa1 / main.dart
Created December 20, 2022 19:05
Strange Dart 5
class C {
dynamic get a {
print('C.a getter called');
return (x) => print('C.a return value called');
}
}
void main() {
var x = C();
@osa1
osa1 / main.dart
Last active November 30, 2022 13:33
Strange Dart 4
class A {
void f() {
print('A.f called');
}
}
class B implements A {
void f({int test}); // optional non-nullable with no default value, also not a valid override
// `f` above is not valid without a `noSuchMethod`
@osa1
osa1 / main.dart
Created November 19, 2022 09:26
Strange Dart 3
class A {
void f() {}
}
extension B on A {
void g() {}
}
void main() {
final a = A();
@osa1
osa1 / main.dart
Created November 11, 2022 20:01
Strange Dart 2
class A {
void f() {
print('A.f called');
}
}
class B extends A {
@override
void f();
}
@osa1
osa1 / main.dart
Created November 11, 2022 19:57
Strange Dart 1
void voidFun() => 123;
class A<T> {
T x;
A (this.x);
Object? getX() => x;
}
@osa1
osa1 / share_send_app_endpoints.md
Created June 23, 2022 20:12 — forked from StephenBlackWasAlreadyTaken/share_send_app_endpoints.md
DexcomShare Endpoints for the Uploader App
  • these are the calls used by the dexcom uploader app
  • these are in no particular order!
  • User-Agent: Dexcom%20Share/3.0.2.11 CFNetwork/672.0.2 Darwin/14.0.0

General

Read Dexcoms System time clock

GET

@osa1
osa1 / dotfiles
Created October 14, 2021 18:58 — forked from rosghub/dotfiles
Manjaro i3 Hi-DPI config
#
# Configuration files for Manjaro i3 on Lenovo Yoga 2 pro
# to scale properly on HiDPI (3200x1800)
#
#####################################################
~/.profile #
#####################################################
# UI element scaling, icons
export GDK_SCALE=2
@osa1
osa1 / replace_char_codes.rs
Last active June 18, 2021 08:41
Replace '\u{...}' with '<char>'
use std::convert::TryFrom;
use std::io::{stdin, BufRead};
use std::process::exit;
use regex::{Captures, Regex};
fn main() {
let re = Regex::new(r"'\\u\{([0-9A-Fa-f]+)\}'").unwrap();
let stdin = stdin();
diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim
index 94cf8d0..4e58385 100644
--- a/autoload/fugitive.vim
+++ b/autoload/fugitive.vim
@@ -2147,7 +2147,7 @@ function! fugitive#BufReadCmd(...) abort
if b:fugitive_display_format
call s:ReplaceCmd([dir, 'cat-file', b:fugitive_type, rev])
else
- call s:ReplaceCmd([dir, '-c', 'diff.noprefix=false', 'show', '--no-color', '-m', '--first-parent', '--pretty=format:tree%x20%T%nparent%x20%P%nauthor%x20%an%x20<%ae>%x20%ad%ncommitter%x20%cn%x20<%ce>%x20%cd%nencoding%x20%e%n%n%s%n%n%b', rev])
+ call s:ReplaceCmd([dir, '-c', 'diff.noprefix=false', 'show', '--no-color', '-m', '--first-parent', '--pretty=format:commit%x20%H%ntree%x20%T%nparent%x20%P%nauthor%x20%an%x20<%ae>%x20%ad%ncommitter%x20%cn%x20<%ce>%x20%cd%nencoding%x20%e%n%n%s%n%n%b', rev])
@osa1
osa1 / zshrc
Created January 21, 2021 09:55
chpwd() {
local new_dir=${$(pwd)#${HOME}/}
if [[ $new_dir == $HOME ]]; then
echo "Returning to home"
return
fi
local shell_file_path=$HOME/shells/$new_dir.zsh
if [[ -e $shell_file_path ]]; then