Skip to content

Instantly share code, notes, and snippets.

@elazdins
elazdins / git-branch-from-remote-ftp.sh
Created August 24, 2016 12:10
Pull in latest FTP changes from a remote server and create a new git branch based on them
#! /bin/bash
now=$(date +"%d-%m-%Y")
cd /path/to/local/project
git checkout master
git pull remote master
git branch $now
git checkout $now
lftp -e 'set ssl:verify-certificate no; mirror -P 10 -v /remote/folder/ /path/to/local/project/.' -u username,password FTP_SERVER_IP
git add -A
#!/usr/bin/php
<?php
/*
* Convert JSON file to CSV and output it.
*
* JSON should be an array of objects, dictionaries with simple data structure
* and the same keys in each object.
* The order of keys it took from the first element.
*
* Example: