Skip to content

Instantly share code, notes, and snippets.

View amoghpalnitkar's full-sized avatar

Amogh Palnitkar amoghpalnitkar

View GitHub Profile
@virolea
virolea / upload.js
Last active March 15, 2024 13:45
Tracking file upload progress using axios
upload(files) {
const config = {
onUploadProgress: function(progressEvent) {
var percentCompleted = Math.round((progressEvent.loaded * 100) / progressEvent.total)
console.log(percentCompleted)
}
}
let data = new FormData()
data.append('file', files[0])
exec > /tmp/${PROJECT_NAME}_archive.log 2>&1
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal
if [ "true" == ${ALREADYINVOKED:-false} ]
then
echo "RECURSION: Detected, stopping"
else
export ALREADYINVOKED="true"
@suruja
suruja / gist:10241312
Created April 9, 2014 08:27
Mongo dump and restore on Heroku
require 'uri'
namespace :mongo do
desc "Dump the production database and restore to development and staging databases."
task :dump_and_restore => :environment do
dev = URI.parse(ENV["MONGO_URI"])
prod = URI.parse(`heroku config:get MONGO_URI --remote production`)
prod_username, prod_password = prod.userinfo.split(':')