Skip to content

Instantly share code, notes, and snippets.

Avatar

A Flow of Code AFlowOfCode

View GitHub Profile
@AFlowOfCode
AFlowOfCode / decrypt_devise_cookie.rb
Created Jan 15, 2019
Decrypts a Rails (Devise/Warden) cookie in ruby
View decrypt_devise_cookie.rb
@AFlowOfCode
AFlowOfCode / extension-autobuild.bat
Created Oct 17, 2019
Batch file to automatically create uploadable zip packages for a browser extension written for both Firefox and Chrome. See this repo for an example where this would be useful: https://github.com/AFlowOfCode/bandcamp-streamer
View extension-autobuild.bat
REM requires 7zip - https://www.7-zip.org/download.html
REM run this from the parent folder of the extension directory
REM excludes .git folder & other browser's manifest by default
REM change path to 7z.exe & the extension directory as needed
REM Firefox
rename "%CD%\extension\manifest-firefox.json" manifest.json
"%PROGRAMFILES%/7-zip/7z" a extension-firefox.zip .\extension\* -xr!.git -xr!manifest-chrome.json
rename "%CD%\extension\manifest.json" manifest-firefox.json
@AFlowOfCode
AFlowOfCode / decrypt_devise_cookie.php
Created Jan 15, 2019
Decrypts a Rails (Devise/Warden) cookie in PHP
View decrypt_devise_cookie.php
@AFlowOfCode
AFlowOfCode / gitpull.sh
Created Apr 24, 2018
Simple bash script to update & restart a rails app on a live dev server when triggered by a webhook set to repo push. Args to script are: head_commit.id, pusher.name, pusher.email
View gitpull.sh
#!/bin/sh
echo "commit: $1 by: $2 $3"
cd your/git_rails/project_root #REPLACE THIS
git pull
if [ -f tmp/pids/server.pid ]; then
echo "killing rails server"
kill -9 $(cat tmp/pids/server.pid)
fi
bundle install
rails db:migrate RAILS_ENV=development