Skip to content

Instantly share code, notes, and snippets.

View romdim's full-sized avatar

Romanos Tsouroplis romdim

View GitHub Profile
@romdim
romdim / git fix gitignore cache issues
Created March 11, 2015 09:39
git fix gitignore cache issues
git rm -r --cached .
git add .
git commit -m "fixed untracked files"
@romdim
romdim / add-migration
Created March 11, 2015 09:46
Enable Migrations, Add Init, Update DB
Enable-Migrations –EnableAutomaticMigrations
Add-Migration Init
Update-Database
@romdim
romdim / Restart sqllocaldb - update db
Created March 11, 2015 09:51
Stop and restart Local SQL DB and do update
sqllocaldb.exe stop v11.0
sqllocaldb.exe delete v11.0
Update-Database
@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"
defaults: &defaults
adapter: postgresql
encoding: unicode
pool: 5
reconnect: true
development:
<<: *defaults
url: <% ENV['DATABASE_URL'] %>
apiVersion: v1
kind: Secret
metadata:
name: drone-secrets
type: Opaque
data:
server.secret: REPLACE-THIS-WITH-BASE64-ENCODED-VALUE
@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
@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 / 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 / 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