This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.sftptogo; | |
import com.jcraft.jsch.*; | |
import com.sftptogo.util.Util; | |
import java.util.Properties; | |
import java.util.Vector; | |
/** | |
* A simple SFTP client using JSCH http://www.jcraft.com/jsch/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let Client = require('ssh2-sftp-client'); | |
class SFTPClient { | |
constructor() { | |
this.client = new Client(); | |
} | |
async connect(options) { | |
console.log(`Connecting to ${options.host}:${options.port}`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module FileServices | |
class FileImporterService < ApplicationService | |
attr_reader :shop | |
class FileCreateError < StandardError | |
end | |
def initialize(shop) | |
@shop = shop | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'net/sftp' | |
require 'uri' | |
class SFTPClient | |
def initialize(host, user, password) | |
@host = host | |
@user = user | |
@password = password | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pysftp | |
from urllib.parse import urlparse | |
import os | |
class Sftp: | |
def __init__(self, hostname, username, password, port=22): | |
"""Constructor Method""" | |
# Set connection object to None (initial value) | |
self.connection = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class SFTPClient | |
{ | |
private $connection; | |
private $sftp; | |
public function __construct($host, $port=22) | |
{ | |
$this->connection = @ssh2_connect($host, $port); | |
if (! $this->connection) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"io" | |
"os" | |
"net" | |
"net/url" | |
"bufio" | |
"strings" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# to install xplenty python SDK run: pip install xplenty | |
# more info here: https://github.com/xplenty/xplenty.py | |
from xplenty import XplentyClient | |
import time | |
account_id = "" # your account id (http://app.xplenty.com/account_id/) | |
api_key = "" # your api key (get it here https://app.xplenty.com/settings/edit) | |
cluster_nodes = 1 # required number of nodes in cluster |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
outputSchema "bag:{tuple:()}" | |
def bags_interection bag1, bag2 | |
return nil if bag1.nil? | |
return nil if bag2.nil? | |
bag = bag1.map{ |x| x } & bag2.map{ |x| x } | |
db = DataBag.new | |
bag.each { |x| db.add(x) } | |
db | |
end |