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
#!/bin/sh | |
# Change these settings to match what you are wanting to do | |
FILE=/File/To/Copy | |
SERVER=localhost | |
PATH=/Where/To/Put/File | |
OPTIONS=`vagrant ssh-config | awk -v ORS=' ' '{print "-o " $1 "=" $2}'` | |
scp ${OPTIONS} $FILE vagrant@$SERVER:$PATH |
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
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 |
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
##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## |
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
/** | |
* 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 = { |
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
# Pulled from https://stackoverflow.com/questions/18641864/git-bash-shell-fails-to-create-symbolic-links | |
# https://stackoverflow.com/users/124119/camilo-martin | |
# Detect windows (assumes we are in 'msysgit' or similar). | |
windows() { [[ -n "$WINDIR" ]]; } | |
# Remove a link, cross-platform. | |
rmlink() { | |
if windows; then | |
# Again, Windows needs to be told if it's a file or directory. |
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
<VirtualHost *:80> | |
# ... | |
<IfModule mod_headers.c> | |
# Allow some urls, block all others; whitelisting | |
<LocationMatch ^((?!(firstUrlAllowed|secondUrlAllowed)).)*$> | |
Header always append X-Frame-Options SAMEORIGIN # Block any site from applying an iframe. | |
</LocationMatch> | |
</IfModule> | |
</VirtualHost> |
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
# ssh-keygen -R hostname [-f known_hosts_file] | |
# ssh-keygen -r hostname [-f input_keyfile] [-g] | |
#e.g. | |
ssh-keygen -R 192.168.99.99 | |
ssh-keygen -R mytestdomain.vagrant |
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 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); | |
} |
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
# Pulled from https://stackoverflow.com/questions/18641864/git-bash-shell-fails-to-create-symbolic-links | |
# https://stackoverflow.com/users/124119/camilo-martin | |
# Detect windows (assumes we are in 'msysgit' or similar). | |
windows() { [[ -n "$WINDIR" ]]; } | |
# Cross-platform symlink function. | |
# With one parameter, it will check whether the parameter is a symlink. | |
# With two parameters, it will create a symlink to a file or directory, | |
# with syntax: link $linkname $target |
OlderNewer