Skip to content

Instantly share code, notes, and snippets.

View eivindingebrigtsen's full-sized avatar

Eivind Ingebrigtsen eivindingebrigtsen

View GitHub Profile
var sendToContentful = (fileSend)=>{
var name = '';
var data = {};
var names = {};
var addEntryToData = (pathname)=>{
var filename = path.basename(pathname);
var longlocale = filename.substr(0,5);
if(exactMatches.indexOf(longlocale.toUpperCase()) != -1){
[
{
"status": {
"read": {
"status": "1"
}
},
"options": {
"products": []
}
[{category: "Magazine", type: "Multipage", format: "A4", paper: "Matt coated", pages: "52", market: "Russia"},{category: "Magazine", type: "Multipage", format: "A4", paper: "Matt coated", pages: "40", market: "Brazil"},{category: "Brochure", type: "Multipage", format: "A4", paper: "Matt coated", pages: "16", market: "Germany"},{category: "Brochure", type: "Multipage", format: "A4", paper: "Matt coated", pages: "12", market: "Germany"},{category: "Brochure", type: "Multipage", format: "A4", paper: "Matt coated", pages: "36", market: "Germany"},{category: "Brochure", type: "Tri-Folded", format: "DL", paper: "Matt coated", pages: "8", market: "Germany"},{category: "Brochure", type: "DL single fold", format: "DL", paper: "Matt coated", pages: "4", market: "Germany"},{category: "Brochure", type: "Multipage", format: "A4", paper: "Matt cover, gloss pages", pages: "Don't know", market: "China"},{category: "Brochure", type: "Multipage", format: "A4", paper: "Matt cover, gloss pages", pages: "Don't know", market: "Chi
/**
* LiquidMetal, version: 1.3.0 (2014-08-19)
*
* A mimetic poly-alloy of Quicksilver's scoring algorithm, essentially
* LiquidMetal.
*
* For usage and examples, visit:
* http://github.com/rmm5t/liquidmetal
*
* Licensed under the MIT:
<meta property="al:android:url" content="nytimes://reader/id/100000004907200" />
<meta property="al:android:package" content="com.nytimes.android" />
<meta property="al:android:app_name" content="NYTimes" />
<meta name="twitter:app:name:googleplay" content="NYTimes" />
<meta name="twitter:app:id:googleplay" content="com.nytimes.android" />
<meta name="twitter:app:url:googleplay" content="nytimes://reader/id/100000004907200" />
<link rel="alternate" href="android-app://com.nytimes.android/nytimes/reader/id/100000004907200" />
<meta property="al:iphone:url" content="nytimes://www.nytimes.com/2017/02/01/us/politics/donald-trump-islam.html" />
var w = window,
q = w.ga ? w.ga.q : [];
w.ga = function(){
var d = document,
n = navigator,
e = w.encodeURIComponent || w.escape,
str = '',
t = {},
a = arguments,
send = true;
var calculateSavingsvalue = function(years, monthlyAmount, additionalAnualSavings, balance){
var investment = monthlyAmount;
var annualRate = self.profile.expectedReturn;
var monthlyRate = (annualRate / 12 / 100) || 0;
var additionalMonthlyRate = (additionalAnualSavings / 12 / 100) || 0;
var months = years * 12;
var data = {
"results" : [
{
"address_components" : [
{
"long_name" : "1600",
"short_name" : "1600",
"types" : [ "street_number" ]
},
{
@eivindingebrigtsen
eivindingebrigtsen / tree.js
Created April 25, 2012 10:50 — forked from bgstaal/tree.js
Make tree structure from map object
var tree = function(map)
{
var treeStructure = {};
var names;
var name;
var i;
var numNames;
var currentObject = treeStructure;
var lastIndex;
{
"pension": {
"plan": {
"year1": {
"total": {
"payout": "100000"
}
}
},
"payout": {