Skip to content

Instantly share code, notes, and snippets.

View Nikita240's full-sized avatar
👨‍💻
Working

Nikita Rushmanov Nikita240

👨‍💻
Working
  • Woven by Toyota
  • Palo Alto, United States
View GitHub Profile
@Nikita240
Nikita240 / subtrees.sh
Created June 7, 2017 08:12
Convert git submodules to git subtrees
#!/bin/bash -x
# This script will convert all your git submodules into git subtrees.
# This script ensures that your new subtrees point to the same commits as the
# old submodules did, unlike most other scripts that do this.
# THIS SCRIPT MUST BE PLACED OUTSIDE OF YOUR REPOSITORY!!!!!!!!!!
# Otherwise, the script will interfere with the git commits (unless you add it to .gitignore).
# Save the script in your home directory as `~/subtrees.sh`
# `cd` into your repository
# Run `~/subtrees.sh`
# Enjoy!
@Nikita240
Nikita240 / led-tach.ino
Last active November 25, 2022 06:36
arduino-tachometer
#include <Adafruit_NeoPixel.h>
const int LED_PIN = 6;
const int TACH_PIN = 2;
const int BRIGHTNESS = 100;
const int LED_COUNT = 80;
const int REDLINE = 7500;
const int WARN_RPM = 6000;
const int WARN_INTERVAL = 70;
@Nikita240
Nikita240 / names.sh
Last active March 23, 2016 03:31
Splits a Name column in a .csv file into FirstName and LastName
# *******************************USAGE*******************************
# cat names.csv | ./name.sh > names-processed.csv
target_col=3
new_title="FirstName,LastName,"
#pass the header line through the buffer first
read header
title=$(echo $header | sed -r "s/([^,]*,){$target_col}.*$/\1/")
echo $header | sed -r "s/$title/$new_title/"