Skip to content

Instantly share code, notes, and snippets.

View chrisdlees's full-sized avatar

Chris Lees chrisdlees

View GitHub Profile
@mbaersch
mbaersch / konamicode-easteregg.js
Last active November 4, 2021 01:50
Konami code easter egg for websites
<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)
@yasirkula
yasirkula / FileDownloader.cs
Last active June 3, 2024 20:04
C# Download Public File From Google Drive™ (works for large files as well)
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Net;
using System.Text;
/* EXAMPLE USAGE
FileDownloader fileDownloader = new FileDownloader();
# 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
@jaywon
jaywon / job-import.js
Created November 10, 2015 22:16
CSV import utility for Node
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