Skip to content

Instantly share code, notes, and snippets.

View RockinPaul's full-sized avatar
🐢

Paul Zarudnev RockinPaul

🐢
  • Amsterdam, Netherlands
View GitHub Profile
<!-- Add this file to: ~/Library/Developer/Xcode/UserData/FontAndColorThemes -->
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>DVTConsoleDebuggerInputTextColor</key>
<string>0.901961 0.831373 0.639216 1</string>
<key>DVTConsoleDebuggerInputTextFont</key>
<string>SFMono-Bold - 11.0</string>
<key>DVTConsoleDebuggerOutputTextColor</key>
@RockinPaul
RockinPaul / extract.dart
Created August 26, 2022 08:12 — forked from magnatronus/extract.dart
Extracting BBC Micro:bit accelerometer data using Flutter Blue
/// This gist assumes that Flutter Blue (https://github.com/pauldemarco/flutter_blue) is used to connect to a BBC Micro:bit
/// and is listening to the [device.onValueChanged] for the correct characteristic ("E95DCA4B-251D-470A-A062FA1922DFA9A8")
///
/// this will be something similar to
///
/// device.onValueChanged( (accChar).listen( (value){ convertRawData(value)}));
///
/// the 'raw' listen value is a List<int> of length 6 this needs to be converted into the X,Y and Z values from the
/// accelerometer and is done with the function below
///
@RockinPaul
RockinPaul / main.dart
Created June 21, 2022 10:45 — forked from ilikerobots/main.dart
Basic examples: Dart call() and Function.apply()
class Adder implements Function {
call(int a, int b) => a + b;
}
class Incrementer implements Function {
int _amt;
Incrementer(this._amt);
call(int a) => a + _amt;
}
@RockinPaul
RockinPaul / custom_tab_bar.dart
Created May 17, 2022 07:30 — forked from theachoem/status_tab_bar.dart
TabBar with badge that update color on swap - Demo included (Flutter)
// Copyright 2021, Thea Choem, All rights reserved.
import 'package:badges/badges.dart';
import 'package:flutter/material.dart';
class CustomTabBarItem {
final String label;
final String? value;
CustomTabBarItem({
/// Based on the answer of Przemek Broda:
/// https://stackoverflow.com/questions/51825779/blur-background-behind-dialog-flutter/62361699#62361699
import 'dart:ui';
import 'package:flutter/material.dart';
void showProgressView(BuildContext context, {bool dismissible = false}) {
showGeneralDialog(
context: context,
barrierColor: Theme.of(context).colorScheme.surface.withOpacity(0.5),
import 'package:flutter/material.dart';
class Example extends StatelessWidget {
const Example({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
final colorScheme = Theme.of(context).colorScheme;

Working with requirements.txt

pip install -r requirements.txt  

Virtual Environment Setup

Navigate to the directory of a Python project you want to run in virtual environment:

cd path/to/target/project

Define virtual environment:

@RockinPaul
RockinPaul / linebreak.md
Created January 11, 2022 15:17
Line breaks in markdown
Hello  (<-- two spaces)
World

Hello
World


@RockinPaul
RockinPaul / revert-a-commit.md
Created January 2, 2022 14:02 — forked from gunjanpatel/revert-a-commit.md
Git HowTo: revert a commit already pushed to a remote repository

Revert the full commit

Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.

git revert {commit_id}

About History Rewriting

Delete the last commit

Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32: