Skip to content

Instantly share code, notes, and snippets.

View hereisderek's full-sized avatar
😐
- =

Derek Zhu hereisderek

😐
- =
View GitHub Profile
@hereisderek
hereisderek / combine.sh
Last active April 14, 2023 23:42
script to combine xiaomi camera recordings
#!/bin/bash
## to get the latest version of this script, see: https://gist.githubusercontent.com/hereisderek/6a2ca0afcc957858d8a465392212edb8/raw/combine.sh
## to run this script as a cron task:
## * * * * * /usr/bin/wget -qO- https://gist.githubusercontent.com/hereisderek/6a2ca0afcc957858d8a465392212edb8/raw/combine.sh | /bin/bash -s /mnt/xiaomi/xiaomi_camera_videos /mnt/xiaomi/xiaomi_camera_videos/output >/dev/null 2>&1
function example_usage {
export your_healthcheck_url="https://hc-ping.com/37174a73-****-****" && wget "${your_healthcheck_url}/start" -T 10 -t 5 -O /dev/null && wget --no-cache 'https://gist.githubusercontent.com/hereisderek/6a2ca0afcc957858d8a465392212edb8/raw/combine.sh' -qO /tmp/combine.sh && chmod a+x /tmp/combine.sh && /tmp/combine.sh && wget "${your_healthcheck_url}" -T 10 -t 5 -O /dev/null
}
@hereisderek
hereisderek / zram.sh
Created October 27, 2022 02:53
create ramdisk on startup
#!/bin/bash
### BEGIN INIT INFO
# Provides: zram
# Required-Start: $all
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: your description here
### END INIT INFO
#
@hereisderek
hereisderek / MaterialColors.kt
Last active July 22, 2021 03:16 — forked from daniellevass/android_material_design_colours.xml
Android Material Design Colours
import androidx.compose.ui.graphics.Color
/**
*
* google's material design colours from
* http://www.google.com/design/spec/style/color.html#color-ui-color-palette
* https://gist.github.com/daniellevass/b0b8cfa773488e138037
*
*/
# rclone's log
Jun 28 16:12:36 pi2 rclone[499]: Video/Others/: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxrwx, err=<nil>
Jun 28 16:12:36 pi2 rclone[499]: Video/Others/: Lookup: name="mi_camera"
Jun 28 16:12:36 pi2 rclone[499]: Video/Others/: >Lookup: node=Video/Others/mi_camera/, err=<nil>
Jun 28 16:12:36 pi2 rclone[499]: Video/Others/mi_camera/: Attr:
Jun 28 16:12:36 pi2 rclone[499]: Video/Others/mi_camera/: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxrwx, err=<nil>
Jun 28 16:12:36 pi2 rclone[499]: Video/Others/mi_camera/: Lookup: name="netease_.swp"
Jun 28 16:12:36 pi2 rclone[499]: Video/Others/mi_camera/: >Lookup: node=Video/Others/mi_camera/netease_.swp, err=<nil>
@hereisderek
hereisderek / install_oh_my_zsh.sh
Last active May 18, 2020 10:02
install oh my zsh to ~/.config/oh-my-zsh
sh -c "mkdir -p ~/.config/; ZSH=~/.config/oh-my-zsh $(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
./gradlew tasks --all[?1l>[?2004l
]2;./gradlew tasks --all]1;./gradlew
<-------------> 0% CONFIGURING [0s]> root project > Resolve dependencies of :classpath<-------------> 0% CONFIGURING [0s]> root project > :app<-------------> 0% CONFIGURING [0s]> root project > :app<-------------> 0% CONFIGURING [0s]> root project > :app<-------------> 0% CONFIGURING [0s]> root project > :app<-------------> 0% CONFIGURING [0s]> root project > :app<-------------> 0% CONFIGURING [0s]> root project > :app<-------------> 0% CONFIGURING [0s]> root project > :app
> Configure project :app
C
@hereisderek
hereisderek / util.dart
Created September 14, 2018 17:48
dart utility class
import 'dart:math' as Math;
import 'dart:ui';
//import 'package:flutter/foundation.dart';
//import 'package:recorder/util/logger.dart';
import 'package:uuid/uuid.dart';
const _TAG = 'Util';
@hereisderek
hereisderek / flutter log
Last active September 13, 2018 19:31
flutter #20781 log
```
flutter doctor -v
Building flutter tool...
[✓] Flutter (Channel derek/master, v0.8.3-pre.50, on Mac OS X 10.14 18A389, locale en-US)
• Flutter version 0.8.3-pre.50 at /Volumes/Persistence/Library/Google/flutter
• Framework revision efab60dbe9 (21 hours ago), 2018-09-12 15:44:23 -0700
• Engine revision 12315736f9
• Dart version 2.1.0-dev.4.0.flutter-05ccfa8502
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.2)
@hereisderek
hereisderek / main.dart
Last active September 13, 2018 16:04
Dart language snippit
void main() {
/// maps
/// result:
/// map0: {1: 1, 2: 2}
/// map1: {1: 1, 2: 2}
/// map2: {1: 2, 2: 3}
Map<String, int> map = {'1' : 1, '2' : 2};
print('map0: $map');
@hereisderek
hereisderek / main.dart
Last active September 11, 2018 15:34
dart 'with' mixin classes
abstract class SayI{
String say();
String get str;
}
abstract class SayMixinA implements SayI{
String get str;
String say() {