Skip to content

Instantly share code, notes, and snippets.

View utopicnarwhal's full-sized avatar
🐳

Sergei Danilov utopicnarwhal

🐳
View GitHub Profile
@utopicnarwhal
utopicnarwhal / break_all_text_example.dart
Created July 12, 2024 18:34
Example how to make a text in Flutter to behave like CSS style `word-break: break-all;` but without breaking the copy/cut/share functionality
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
# Correct colors in tmux
set-option -sa terminal-overrides ",xterm*:Tc"
# Set "prefix" to control-s
unbind C-s
set -g prefix C-s
# Enable mouse control
set -g mouse on
@utopicnarwhal
utopicnarwhal / how_to_install.md
Last active March 21, 2025 20:20
Configuration instructions

Termux

Change packages repo (default one doesn't work anymore)

$ termux-change-repo

Switch to CloudFlare one or other

Install zsh shell, git, and other utils. And upgrade all packages

@utopicnarwhal
utopicnarwhal / starship.toml
Last active December 24, 2024 08:42
My config for the starship prompt
# Download by the command line
# mkdir .config
# curl -s "https://api.github.com/gists/f478e66d29abcdfe3a2fb8260c217c08" | jq --raw-output '.files."starship.toml".content' | tee .config/starship.toml
format = """
[](fg:p1_c0)\
([${custom.local_device} ](bg:p1_c0 fg:heartly_red))\
([$hostname ](bg:p1_c0 fg:on_light))\
[](bg:p1_c1 fg:p1_c0)\
[ $os( $username) ](bg:p1_c1 fg:on_dark)\

Keybase proof

I hereby claim:

  • I am utopicnarwhal on github.
  • I am sergeidanilov (https://keybase.io/sergeidanilov) on keybase.
  • I have a public key ASC4SiSXdUh5enDG6SXe-LosMXXDABrCu7dgQ9mCAPXolgo

To claim this, I am signing this object:

@utopicnarwhal
utopicnarwhal / environment_info.dart
Last active March 27, 2024 08:44
Example of a signleton object that manages all the info about the device, package, timezone, etc.
import 'dart:io';
import 'package:example/src/services/logger/logger.dart';
import 'package:device_info_plus/device_info_plus.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';
import 'package:flutter_timezone/flutter_timezone.dart';
import 'package:google_api_availability/google_api_availability.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:timezone/data/latest.dart' as tz_init;
@utopicnarwhal
utopicnarwhal / .p10k.zsh
Created February 13, 2024 15:02
My p10k config
# Generated by Powerlevel10k configuration wizard on 2023-10-10 at 20:04 EEST.
# Based on romkatv/powerlevel10k/config/p10k-classic.zsh, checksum 48479.
# Wizard options: nerdfont-complete + powerline, small icons, classic, unicode, dark,
# angled separators, sharp heads, flat tails, 2 lines, solid, left frame, sparse,
# many icons, concise, transient_prompt, instant_prompt=verbose.
# Type `p10k configure` to generate another config.
#
# Config for Powerlevel10k with classic powerline prompt style. Type `p10k configure` to generate
# your own config based on it.
#
@utopicnarwhal
utopicnarwhal / circular_buffer.dart
Last active February 15, 2024 11:44
A circular buffer with a fixed capacity supporting all the List operations
/// A [CircularBuffer] with a fixed capacity supporting all [List] operations
///
/// ```dart
/// final buffer = CircularBuffer<int>(3)..add(1)..add(2);
/// print(buffer.length); // 2
/// print(buffer.first); // 1
///
/// buffer.add(3);
/// print(buffer.length); // 3
///
@utopicnarwhal
utopicnarwhal / main.dart
Last active December 21, 2023 08:07
Column centers text may go wrong example
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
@utopicnarwhal
utopicnarwhal / install.sh
Last active May 16, 2025 20:44
My plugins install script
#!/bin/zsh
# How to run it:
# Install Zsh here: https://github.com/ohmyzsh/ohmyzsh/wiki/Installing-ZSH
# Change shell: sudo chsh -s $(which zsh) $(whoami)
# Then execute:
# curl -s "https://api.github.com/gists/3b71a0465d7812e71715a1bd3cfa4473" | jq --raw-output '.files."install.sh".content' | tee "install_manager_and_plugins.zsh"
# chmod +x "install_manager_and_plugins.zsh"
# ./"install_manager_and_plugins.zsh"
# rm "install_manager_and_plugins.zsh"