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 fs = require('fs'); | |
var csv = require('fast-csv'); | |
var stream = fs.createReadStream('/home/jaywon/Downloads/modified-salary-per-state-per-jobtitle.csv'); | |
var mongoose = require('mongoose'); | |
var Schema = mongoose.Schema; | |
var masterList = []; | |
var mongoose = require('mongoose'); | |
mongoose.connect('mongodb://localhost:27017/job-imports'); | |
//define schema for import data |
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
# The following will split a CSV (file.csv) into multiple parts of 1 million lines each | |
# with each part having its own header. | |
# | |
# PREFIX denotes the filename to use for the parts. A number will be added to the end. | |
tail -n +2 file.csv | | |
split -d -l 1000000 - --filter='sh -c "{ head -n1 file.csv; cat; } > $FILE"' PREFIX |
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
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.IO; | |
using System.Net; | |
using System.Text; | |
/* EXAMPLE USAGE | |
FileDownloader fileDownloader = new FileDownloader(); |
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
<script> | |
/*Animate element and change text / html if konami code is entered on a page - can be used as custom HTML in Google Tag Manager. | |
Source / idea: https://www.simoahava.com/gtm-tips/add-konami-code-to-your-site/ */ | |
/* SETUP */ | |
//message to display on "konami element" after animation. HTML can be used as well - innerHTML will be replaced with whatever gets defined here. | |
//leave blank for no change (just animation) | |
var konamiMessage = 'you are awesome! ;)</small>'; | |
//CSS Selector for element to animate and display message (e.g. "#someId", "div.someclass". info: https://www.w3schools.com/cssref/css_selectors.asp) |