Skip to content

Instantly share code, notes, and snippets.

@jasantunes
jasantunes / find-recently-modified-files.sh
Created February 15, 2019 07:08
Show recently modified files.
# To get a list of the files that were most recently modified:
find $* -type f -printf "%TY-%Tm-%Td %TH:%TM %p\n" | sort -r -n | head
# If you want to ignore files in hidden directories (that start with dot), such as eclipse metadata files, use:
find $* -not \( -type d -name ".*" -prune \) -and -type f -printf "%TY-%Tm-%Td %TH:%TM %p\n" | sort -r -n | head
@jasantunes
jasantunes / SyncRatings0.1.scpt
Created February 7, 2019 07:59
iTunes sync ratings (deprecated)
(*
Author: Joao Antunes
Version: 0.1
*)
property database_file : "Library:iTunes:Scripts:index_ratings.txt"
property SET_ENCODING : "export LANG=en_US.UTF-8; "
on run
set FILEDB to POSIX path of ((path to home folder as string) & database_file)
@jasantunes
jasantunes / db.rake
Last active July 18, 2017 20:41
Run schema migrations and seeds migrations in chronological order
# lib/tasks/db.rake
require_relative 'helpers/seed_migration_helper'
namespace :db do
desc 'Run db:migrate and seed:migrate in chronological order'
task(migrate_with_data: :environment) do
schema_migrations = SeedMigrationHelper.schema_migrations
seed_migrations = SeedMigrationHelper.seed_migrations
migrations_to_run = (schema_migrations + seed_migrations).sort_by { |k| k[:version] }