Skip to content

Instantly share code, notes, and snippets.

View explodi's full-sized avatar
💭
undefined

Cristian explodi

💭
undefined
View GitHub Profile
@explodi
explodi / hi5.sh
Last active June 22, 2018 17:37
hi5
#!/bin/bash
# based on https://gist.github.com/yellowled/1439610
# on mac, to install ffmpeg, use this: brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
IN=$1
OUT=$(echo $1 | sed 's/^\(.*\)\.[a-zA-Z0-9]*$/\1/')
# webm
ffmpeg -i $IN -f webm -vcodec libvpx -an -ab 128000 -b:v 1M $OUT.webm
# mp4
ffmpeg -i $IN -an -strict experimental -ac 2 -ab 128k -vcodec libx264 -f mp4 $OUT.mp4

#Simple Authentication with Bcrypt

This tutorial is for adding authentication to a vanilla Ruby on Rails app using Bcrypt and has_secure_password.

The steps below are based on Ryan Bates's approach from Railscast #250 Authentication from Scratch (revised).

You can see the final source code here: repo. I began with a stock rails app using rails new gif_vault

##Steps

@explodi
explodi / osx-for-hackers.sh
Created December 21, 2015 23:52 — forked from matthewmueller/osx-for-hackers.sh
OSX for Hackers (Mavericks/Yosemite)
# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'
@explodi
explodi / Better Database Pulling With Heroku
Last active December 23, 2015 18:19 — forked from jackkinsella/Better Database Pulling With Heroku
Now heroku separates columns in pgbackups output with space instead of pipe
#!/bin/bash
# Best use case is to create a file "update_local_db.sh" in your project folder and then call the command with bash update_local_db
# Follow me: @jackkinsella
function LastBackupName () {
heroku pgbackups | tail -n 1 | cut -d" " -f 1
}
# This part assumes you have a low limit on no. of backups allowed
#!/bin/bash
# Perform Backup of all the files
if [[ ! -d ~/Minecraft_Backups/ ]];then
echo "Creating backup directory ~/Minecraft_Backups/"
mkdir -p ~/Minecraft_Backups/
fi
tar -czf ~/Minecraft_Backups/`date +%Y%m%d`-backup.tgz /Applications/MinecraftSP.app