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
/*************************************************************************/ | |
/* Configuration parameters */ | |
var server = "Ftp.indielectro.net" // Ftp.indielectro.net | |
var userName = "indielectro.net" // indielectro.net | |
var password = "Penguin21" // Penguin21 | |
var localFile = "C:\\FtpUpload.html" // a temporary local file name | |
var remoteFile = "public/00/FtpUpload.html" // file name on the remote server |
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
var https = require('https'); | |
var getRepos = function(username, callback) { | |
var options = { | |
host: 'api.github.com', | |
path: '/users/' + username + '/repos', | |
method: 'GET', | |
headers: { | |
'user-agent': 'nodejs' | |
} |
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 csv, datetime | |
def _headers_count(csv_reader): | |
return len(list(csv_reader)[0]) | |
def _get_headers(csv_reader): | |
return list(csv_reader)[0] | |
def _records_count(csv_reader): | |
return len(list(csv_reader)) |
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
def calc_check_digit(value): | |
"""calculate UPCA and UPCE check digit""" | |
check_digit = 0 | |
odd_pos = True | |
for char in str(value)[::-1]: | |
if odd_pos: | |
check_digit += int(char) * 3 | |
else: | |
check_digit += int(char) |
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
{ | |
"foodClass": "Branded", | |
"description": "MOCHI ICE CREAM BONBONS", | |
"foodNutrients": [ | |
{ | |
"type": "FoodNutrient", | |
"id": 3383047, | |
"nutrient": { | |
"id": 1079, | |
"number": "291", |