This file contains hidden or 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 _ from 'lodash'; | |
| import React, { Component } from 'react'; | |
| class Table extends Component { | |
| render() { | |
| const { columns, data } = this.props; | |
| // spread two-dimensional array to arguments for zip | |
| // destructure resulting array elements from zip | |
| let [names, props] = _.zip(...columns); | |
| // build column headers with name values |
This file contains hidden or 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
| func setTimeForDate (date: NSDate, hour: Int, minute: Int, second: Int) -> NSDate { | |
| let unitFlags = [.Year, .Month, .Day, .Hour, .Minute, .Second] as NSCalendarUnit | |
| // calendar here is NSCalendar.currentCalendar() | |
| let dateComponents = calendar.components(unitFlags, fromDate: date) | |
| dateComponents.hour = hour | |
| dateComponents.minute = minute | |
| dateComponents.second = second | |
| let newDate = calendar.dateFromComponents(dateComponents) | |
| print(newDate) | |
| return newDate! |
This file contains hidden or 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 spreadsheet = SpreadsheetApp.getActiveSpreadsheet(), | |
| sheet = SpreadsheetApp.getActiveSheet(), | |
| rows = sheet.getDataRange(), | |
| numRows = rows.getNumRows(), | |
| values = rows.getValues(), | |
| endDate = new Date(), | |
| endDateCell = sheet.getRange("J2"), | |
| archiveCounter = sheet.getRange("K2").getValue(), | |
| archiveFolder = '', | |
| emailCell = sheet.getRange("L2").getValue(), |
This file contains hidden or 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 sheet = SpreadsheetApp.getActiveSheet(), | |
| rows = sheet.getDataRange(), | |
| numRows = rows.getNumRows(), | |
| values = rows.getValues(), | |
| startTimeCol = 3, | |
| endTimeCol = 4, | |
| re = ' at'; | |
| /** | |
| * Retrieves all the rows in the active spreadsheet that contain data and converts Date/Time if necessary |
This file contains hidden or 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 sys | |
| import getopt | |
| import os | |
| import string as str | |
| def findDuplicateFilenames(dir): | |
| unique, dupes = [], [] | |
| try: | |
| for filename in os.listdir(dir): | |
| name = str.split(filename, '.')[0] |
This file contains hidden or 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
| #converts csv data to mysql insert statements | |
| import csv | |
| #prompt user for file name | |
| filename = raw_input("Enter the csv file name: ") | |
| tablename = raw_input("Enter db table name for insert statements: ") | |
| # open csv file | |
| with open(filename + '.csv', 'rb') as csvfile: | |
| # store in dict |