Skip to content

Instantly share code, notes, and snippets.

View AFlowOfCode's full-sized avatar

A Flow of Code AFlowOfCode

View GitHub Profile
@AFlowOfCode
AFlowOfCode / extension-autobuild.bat
Created October 17, 2019 03:04
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
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 January 15, 2019 17:25
Decrypts a Rails (Devise/Warden) cookie in PHP
@AFlowOfCode
AFlowOfCode / decrypt_devise_cookie.rb
Created January 15, 2019 02:12
Decrypts a Rails (Devise/Warden) cookie in ruby
@AFlowOfCode
AFlowOfCode / gitpull.sh
Created April 24, 2018 17:00
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
#!/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