Skip to content

Instantly share code, notes, and snippets.

Drew geedew

Block or report user

Report or block geedew

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@geedew
geedew / unlink.sh
Created Mar 14, 2018
Removing a cross-platform symlink.
View unlink.sh
@geedew
geedew / symlink.sh
Last active Mar 1, 2020
A cross platform symlink method in Bash
View symlink.sh
@geedew
geedew / gist:41e4ba0e043efe645bdc95db1f9008dc
Created Mar 3, 2018
Generating reports from a G Sheet into a Doc
View gist:41e4ba0e043efe645bdc95db1f9008dc
/**
* FOLDER_NAME
* The path, relative to the Sheet the script is running from, where new reports are created
*/
var FOLDER_NAME = "Schedules";
/**
* SPREADSHEET_MAPPING
* Contains Template variables and the columns
var SPREADSHEET_MAPPING = {
@geedew
geedew / Student Schedule
Created Mar 2, 2018
An Octothorpe delimited template for use with Google Sheets report creations.
View Student Schedule
##STUDENT_NAME##
Class Schedule
Teacher Name: ##TEACHER_NAME##
Grade: ##GRADE##
Session 1 Name: ##SESSION_1_NAME##
Teacher: ##SESSION_1_TEACHER##
When: ##SESSION_1_DATE##
Room: ##SESSION_1_ROOM##
@geedew
geedew / gist:97c66b187db2ac8ecebaef535750a76b
Created Dec 2, 2017 — forked from mhawksey/gist:1170597
Google Apps Script to fill in a Document template with Spreadsheet data
View gist:97c66b187db2ac8ecebaef535750a76b
function onOpen() {
var menuEntries = [ {name: "Create Diary Doc from Sheet", functionName: "createDocFromSheet"}];
var ss = SpreadsheetApp.getActiveSpreadsheet();
ss.addMenu("Fitness Diaries", menuEntries);
}
function createDocFromSheet(){
var templateid = "1O4afl8SZmMxMFpAiN16VZIddJDaFdeRBbFyBtJvepwM"; // get template file id
var FOLDER_NAME = "Fitness Diaries"; // folder name of where to put completed diaries
// get the data from an individual user
@geedew
geedew / strip.string.js
Last active Aug 29, 2015
JavaScript String.Strip
View strip.string.js
var strip = function(string, characters) {
if(!characters) {
if(typeof String.prototype.trim !== undefined) {
// Simply use the String.trim as a default
return String.prototype.trim.call(string);
} else {
// set characters to whitespaces
characters = "\s\uFEFF\xA0";
}
}
View node-rm-rf-async.js
var fs = require('fs');
var rmdirAsync = function(path, callback) {
fs.readdir(path, function(err, files) {
if(err) {
// Pass the error on to callback
callback(err, []);
return;
}
var wait = files.length,
count = 0,
@geedew
geedew / node-rm-rf.js
Last active May 26, 2020
Removing a directory that is not empty in NodeJS
View node-rm-rf.js
var fs = require('fs');
var deleteFolderRecursive = function(path) {
if( fs.existsSync(path) ) {
fs.readdirSync(path).forEach(function(file,index){
var curPath = path + "/" + file;
if(fs.lstatSync(curPath).isDirectory()) { // recurse
deleteFolderRecursive(curPath);
} else { // delete file
fs.unlinkSync(curPath);
}
@geedew
geedew / html4-change-input.html
Last active Aug 29, 2015
HTML Change/KeyUp events vs Input event
View html4-change-input.html
<!-- index.html -->
<input id='abc'/>
<script>
var input = document.getElementById('abc');
input.addEventListener('change', function(event) {
// .. only triggers on input loss of focus
});
input.addEventListener('keyup', function(event) {
// .. triggers on any keyboard interaction
View designer.html
<link rel="import" href="../components/polymer/polymer.html">
<polymer-element name="ss-message">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
You can’t perform that action at this time.