Skip to content

Instantly share code, notes, and snippets.

View dmitryrck's full-sized avatar

Dmitry L Rocha dmitryrck

View GitHub Profile
@dmitryrck
dmitryrck / README.md
Last active March 27, 2022 02:03
Easy iPod Shuffle Syncer
View README.md

These are easy to follow instructions, adapt them for your needs 😉.

  1. (IMPORTANT) Create a directory ~/iPod
  2. (IMPORTANT) Mount your iPod in /ipod
  3. Place all of your songs/podcasts into ~/iPod/music
  • Each (first level) directory/folder is one playlist
  1. Run this script

WARNING: if you are in a case sensitive filesystem (very likely if you are using linux) the case of the directories matter.

View upload-amazon-s3.sh
#!/bin/bash
# I am not the author of this script.
# Unfortunately I don't remember where I copied from.
file="${1}"
bucket="${2}"
s3Key="${3}"
s3Secret="${4}"
View README.md
View keybase.md

Keybase proof

I hereby claim:

  • I am dmitryrck on github.
  • I am dmitryrck (https://keybase.io/dmitryrck) on keybase.
  • I have a public key ASAL4TeWH7gczP8CgGUGd1iUGoqT-EvNGKef7omz8azW8wo

To claim this, I am signing this object:

View README.md
$ docker run --rm -v $(pwd):/app -w /app ruby:2.3.7 bash -c "gem install benchmark-ips; ruby /app/benchmark.rb"
Successfully installed benchmark-ips-2.7.2
1 gem installed
{:a=>"1", :b=>2, :c=>nil}
Warming up --------------------------------------
`Hash#[:a] || 3` (key exist)
                       148.791k i/100ms
`Hash#[:c] || 3` (key is nil)
                       141.521k i/100ms
View Gemfile
source "https://rubygems.org"
gem "pg"
gem "sequel_pg", require: "sequel"
@dmitryrck
dmitryrck / README.md
Last active October 5, 2019 21:35
Script to copy Google Chrome profile to ram and after it closes copy back to disk. It does not sync often. Be aware: you can lose your work, login and also sync your profile with a Google account.
View README.md

google-chrome-ram.sh

How to run

Download google-chrome-ram.sh make it executable and call it with or without a profile name.

If you call it like this:

$ ./google-chrome-ram.sh
View README.md

Errata from my last talk:

  1. Crystal lang does not have metaprogramming, but they have macros: https://crystal-lang.org/docs/syntax_and_semantics/macros.html , and there is some tricks here https://github.com/crystal-lang/crystal/wiki/MetaProgramming-Help :)
  2. About arguments (or array of arguments) the official documentation talks about that: https://crystal-lang.org/docs/syntax_and_semantics/default_values_named_arguments_splats_tuples_and_overloading.html
  3. youtube-dl is not a binary for two OS, it is at the end a zip file with python code inside a python file, you can see the content with this (I'm using Linux):
wget https://yt-dl.org/downloads/latest/youtube-dl -O- | sed "1d" | gunzip | less