Skip to content

Instantly share code, notes, and snippets.

@robomatic
robomatic / fetchImages.js
Created October 25, 2021 23:15
fetch remote images for next ssg
// Dependencies :
// npm i download jsdom walk replaceall
const path = require('path')
const fsp = require('fs/promises')
const download = require('download')
const walk = require('walk')
const replaceAll = require("replaceall");
const { JSDOM } = require('jsdom')
@robomatic
robomatic / cellCSVSplitToRows.js
Last active June 10, 2020 17:11
Google Sheets Split Cell CSV Values to Rows
// select the 1 or more rows to set the active range
function cellCSVSplitToRows() {
const sheet = SpreadsheetApp.getActiveSheet()
const aRange = sheet.getActiveRange()
let rowTracker = 0
function setFeatures(range) {
const startIndex = range.getRowIndex()
// target the column with CSV content here
const fColIndex = 3
@robomatic
robomatic / jsonpr.js
Last active April 18, 2016 20:12
NodeJS JSON prettifier for REST piping on the console
'use strict';
/**
* JSON prettifier
*
* as a general prettifier `node jsonpr.js '{"this":"is","json":"prettifier"}'`
* as a stream reader `echo '{"some":"JSON"}' | node jsonpr.js`
*/
process.stdin.setEncoding('utf8');
let stdin = process.openStdin();
let json = process.argv[2];
@robomatic
robomatic / flack.js
Created May 28, 2015 20:27
meteor method call error
Comments = new Mongo.Collection('comments');
if (Meteor.isClient) {
Meteor.subscribe('allComments');
Meteor.call("callMe", "Rob", function(err, result) {
if (err) throw err;
console.log('result: ' + result);
});
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-pages/core-pages.html">
<link rel="import" href="../paper-button/paper-button.html">
<polymer-element name="my-element">
<template>
<style>
@robomatic
robomatic / gist:6627839
Last active December 23, 2015 11:19
Meteor 0.6.5 private package notes
Meteor managed packages reside in:
~/.meteor/packages
NPM packages managed in:
~/.npm
Place private package in folder i.e.
~/code/packages
export a path in .bash_profile for meteor