Skip to content

Instantly share code, notes, and snippets.

View romdim's full-sized avatar

Romanos Tsouroplis romdim

View GitHub Profile
@romdim
romdim / mac-setup.sh
Last active December 10, 2024 18:13
Mac Initial Setup (copied & changed from https://gist.github.com/bradp/bea76b16d3325f5c47d4 )
echo "Creating an SSH key for you..."
ssh-keygen -t rsa
echo "Please add this public key to Github \n"
echo "https://github.com/account/ssh \n"
read -p "Press [Enter] key after this..."
echo "Installing xcode-stuff"
xcode-select --install
@romdim
romdim / tina.sh
Created June 27, 2022 00:49
Init TinaCMS with TS & Tailwind
yarn create next-app -- --typescript
cd folder/
# Add tinaCMS
npx @tinacms/cli@latest init
# Add Tailwind
yarn add -D tailwindcss postcss autoprefixer
npx tailwindcss init -p
@romdim
romdim / Convert to mp3
Created February 4, 2021 12:59
Convert audio files from opus/m4a to mp3
for i in *.opus; do ffmpeg -i "$i" "${i%.*}.mp3"; done
for i in *.m4a; do ffmpeg -i "$i" "${i%.*}.mp3"; done
@romdim
romdim / apfs-fuse-install.sh
Created September 26, 2020 08:44
Install apfs-fuse in Ubuntu 20.04 LTS
sudo apt update
sudo apt install fuse libfuse-dev libicu-dev bzip2 libbz2-dev cmake git libattr1-dev zlib1g-dev g++
sudo snap install cmake --classic
git clone https://github.com/sgan81/apfs-fuse.git
cd apfs-fuse
git submodule init
git submodule update
mkdir build
@romdim
romdim / helpers.js
Created May 12, 2020 17:36
Javascript helper functions
const isLowerCase = str => str === str.toLowerCase();
const isNullOrUndefined = val => val === undefined || val === null;
const smoothScroll = element =>
document.querySelector(element).scrollIntoView({
behavior: 'smooth'
});
const splitLines = str => str.split(/\r?\n/);
@romdim
romdim / 8tracks-dl.sh
Last active February 8, 2018 15:36
8tracks playlist songs downloader using youtube-dl and bash script magic
#!/bin/bash
# Curl the url, get 1-line that contains the mix id, keep only that, remove prefixes and suffixes, add the json url we need for getting the tracklist
url=$(curl https://8tracks.com/$1 | grep embedUrl | awk {'print $3'} | sed -e 's#content="##g' -e 's#player_v3_universal/autoplay"##g' | sed 's/$/tracks_for_international.jsonh/')
# Curl the url that contains tracklist
tracks=$(curl $url)
# Get number of tracks
count=$(echo $tracks | jq '.tracks | length - 1')
# For all tracks download each one
for i in $(seq 0 $count)
do
@romdim
romdim / .env
Last active January 7, 2018 19:11
Files for dockerizing and .env new Rails App
# Rails secret
SECRET_KEY_BASE=NEW_SECRET
DB_POOL=10
DATABASE_URL=postgres://CHANGE_ME:CHANGE_ME123@db/CHANGE_ME_dev
# Puma port
PORT=3000
# Rails outputs to console if this env exists
apiVersion: v1
kind: Secret
metadata:
name: drone-secrets
type: Opaque
data:
server.secret: REPLACE-THIS-WITH-BASE64-ENCODED-VALUE
defaults: &defaults
adapter: postgresql
encoding: unicode
pool: 5
reconnect: true
development:
<<: *defaults
url: <% ENV['DATABASE_URL'] %>
@romdim
romdim / datepicker.coffee
Last active October 5, 2018 21:34 — forked from kdimatteo/datepicker.js
Backbone-Forms implementation of Bootstrap DatePicker
###*
# Bootstrap Datepicker for Backbone.Forms
#
# Quick editor to create a Bootstrap style datepicker (instead of multiple of dropdowns)
# @see: https://github.com/eternicode/bootstrap-datepicker/
# @usage: takes 5 optional schema options: format, minViewMode, autoclose, clearBtn and endDate
# Forked because I wanted to use only years as shown in the example below
schema:
MyDate:
type: "DatePicker"