Skip to content

Instantly share code, notes, and snippets.

View rubenarakelyan's full-sized avatar
💾
Coding and reminiscing

Ruben Arakelyan rubenarakelyan

💾
Coding and reminiscing
View GitHub Profile
@rubenarakelyan
rubenarakelyan / twilio-sms-to-aws-ses.js
Created July 30, 2018 12:10
Twilio function to translate incoming SMS to email
const nodemailer = require('nodemailer');
exports.handler = function(context, event, callback) {
let transporter = nodemailer.createTransport(
{
host: context.SMTP_HOST,
port: context.SMTP_PORT,
auth: {
type: 'login',
user: context.AWS_ACCESS_KEY_ID,
@rubenarakelyan
rubenarakelyan / change-author.sh
Last active September 5, 2021 19:03
Change author of all git commits in repo
git filter-branch --env-filter '
OLD_EMAIL="old@example.com"
CORRECT_NAME="My Name"
CORRECT_EMAIL="new@example.com"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
export GIT_COMMITTER_NAME="$CORRECT_NAME"
export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL"
@rubenarakelyan
rubenarakelyan / move-lightroom-originals.rb
Created April 28, 2020 15:03
Move Lightroom CC original files into album-named folders
require "sqlite3"
require "fileutils"
db = SQLite3::Database.new("database/catalog.db")
# Get list of albums
albums = {}
db.execute("select * from albums") do |album|
albums[album[1]] = album[3]
end
@rubenarakelyan
rubenarakelyan / CompareTools.plist
Created April 14, 2021 10:05
Use Visual Studio Code as a diff and merge tool for Tower 3 (place all files to ~/Library/Application Support/com.fournova.Tower3/CompareTools/ and restart Tower)
<?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">
<array>
<dict>
<key>ApplicationIdentifier</key>
<string>com.microsoft.VSCode</string>
<key>ApplicationName</key>
<string>Visual Studio Code</string>
@rubenarakelyan
rubenarakelyan / Workspace.code-workspace
Last active January 1, 2023 11:10
Visual Studio Code workspace settings
{
"folders": [],
"settings": {
"diffEditor.ignoreTrimWhitespace": false,
"editor.acceptSuggestionOnEnter": "off",
"editor.bracketPairColorization.enabled": true,
"editor.emptySelectionClipboard": false,
"editor.formatOnPaste": true,
"editor.formatOnSave": true,
"editor.rulers": [80],
@rubenarakelyan
rubenarakelyan / git-commands.md
Created December 21, 2021 15:55
List of commonly-used git commands

Squash commits

git rebase -i origin

Force push without changes

git commit --amend --no-edit && git push -f

Change file permissions

@rubenarakelyan
rubenarakelyan / zip-commands.md
Created December 21, 2021 15:56
List of commonly-used zip commands

Zip a folder

zip -r [archive] [folder]

Zip a folder and encrypt with a password

zip -er [archive] [folder]

@rubenarakelyan
rubenarakelyan / bash-scripts.md
Last active March 31, 2022 12:22
List of useful mini bash scripts

Find files from a list

while read -r file
do
  find . -name "$file"
done < list.txt

Convert JSON to CSV

@rubenarakelyan
rubenarakelyan / macos-scripts.md
Last active January 25, 2022 14:44
List of useful mini macOS scripts

Mount FAT32 partition in macOS with write permissions

diskutil list
sudo diskutil unmount /dev/disk2s1
sudo mkdir /Volumes/NAME
sudo mount -w -t msdos /dev/disk2s1 /Volumes/NAME

Convert HEIC images to JPEG and delete originals

@rubenarakelyan
rubenarakelyan / vscode-tasks.md
Created December 21, 2021 16:30
Instructions for quick tasks in Visual Studio Code

Copy search results to clipboard

  • CTRL + F
  • Type your search string
  • CTRL + SHIFT + L to select all occurrences found (max. 999)
  • ESC (or close search dialog with top-right X)
  • CTRL + I to select whole lines
  • CTRL + C
  • Open new file
  • CTRL + V