Skip to content

Instantly share code, notes, and snippets.

View ajot's full-sized avatar

Amit Jotwani ajot

View GitHub Profile
@ajot
ajot / GetCurrentWeek.applescript
Created August 26, 2023 12:41
Automating Weekly Review Date Headers with AppleScript and TextExpander
-- Blog Post: https://ajot.me/finding-the-current-weeks-start-and-end-dates-in-applescript/
-- Get the current date
set currentDate to current date
-- Get the current day of the week as a number (Sunday is 1, Monday is 2, etc.)
set currentDay to weekday of currentDate as integer
-- Calculate the date of the beginning of the week (Monday)
-- We use "currentDay - 2" because in AppleScript, Monday is represented by 2.
@ajot
ajot / 0_reuse_code.js
Created March 15, 2016 00:04
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@ajot
ajot / lastUpdatedSpreadsheet
Created June 20, 2014 20:12
Get Last Updated Date - Google Spreadsheet
function onEdit() {
Logger.log("Starting");
var email = Session.getEffectiveUser().getEmail();
Logger.log(email);
// Getting the Current Spreadsheet
var s = SpreadsheetApp.getActiveSheet();
var r = s.getActiveCell(); //Getting the active cell
if( r.getColumn() != 2 ) { //checks the column
@ajot
ajot / lastUpdated
Created June 20, 2014 19:46
Get Last Updated Date - Google Spreadsheet
function onEdit() {
Logger.log("Starting");
var email = Session.getEffectiveUser().getEmail();
Logger.log(email);
var s = SpreadsheetApp.getActiveSheet();
var r = s.getActiveCell();
if( r.getColumn() != 2 ) { //checks the column
if( r.getRow() != 1 ) {
var row = r.getRow();
/*This is a test again*/
/*This is a test*/