Skip to content

Instantly share code, notes, and snippets.

View nicksuch's full-sized avatar

Nick Such nicksuch

View GitHub Profile
@ttrahan
ttrahan / block_personal_appts
Last active April 10, 2024 13:47
Google Apps Script to automatically create, edit and delete events on work calendar for personal calendar events. Instructions on how to set up can be found at https://medium.com/@willroman/auto-block-time-on-your-work-google-calendar-for-your-personal-events-2a752ae91dab
function sync() {
var id="XXXXXXXXXX"; // CHANGE - id of the secondary calendar to pull events from
var today=new Date();
var enddate=new Date();
enddate.setDate(today.getDate()+7); // how many days in advance to monitor and block off time
var secondaryCal=CalendarApp.getCalendarById(id);
var secondaryEvents=secondaryCal.getEvents(today,enddate);
@wroman
wroman / calendarblock
Last active July 31, 2023 21:04
Auto Block Time on Primary Google Calendar from Events on Secondary Calendar - Instructions: https://medium.com/@willroman/auto-block-time-on-your-work-google-calendar-for-your-personal-events-2a752ae91dab
function sync() {
var id="XXXXXXXX"; // CHANGE - id of the secondary calendar to pull events from
var secondaryCal=CalendarApp.getCalendarById(id);
var today=new Date();
var enddate=new Date();
enddate.setDate(today.getDate()+30); // how many days in advance to monitor and block off time
var secondaryEvents=secondaryCal.getEvents(today,enddate);
@tomysmile
tomysmile / mac-php-composer-setup.md
Created July 11, 2016 10:45
Setup PHP Composer using Brew
// These two need to be declared outside the try/catch
// so that they can be closed in the finally block.
HttpURLConnection urlConnection = null;
BufferedReader reader = null;
// Will contain the raw JSON response as a string.
String forecastJsonStr = null;
try {
// Construct the URL for the OpenWeatherMap query
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active May 2, 2024 05:55
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@hubgit
hubgit / list-files-in-folder.js
Created September 20, 2012 11:20
List all files in a folder (Google Apps Script)
function listFilesInFolder() {
var folder = DocsList.getFolder("Maudesley Debates");
var contents = folder.getFiles();
var file;
var data;
var sheet = SpreadsheetApp.getActiveSheet();
sheet.clear();
@ryanj
ryanj / eventbrite-multi-discount.rb
Created May 24, 2011 22:27
a script to help automate adding or updating discount codes for multiple events
#!/usr/bin/ruby
#
# This work is licensed under a Creative Commons Attribution 3.0 Unported License.
# http://creativecommons.org/licenses/by/3.0/
#
# With some slight modifications, this script should create
# a new discount code for each of the 'live' events which are
# owned by the user (who is identified by the user_key value).
#
# See the above license info and Eventbrite API terms for usage limitations.
@fredoliveira
fredoliveira / SCVNGR.md
Created April 2, 2011 15:52
Game mechanics deck from SCVNGR. More info: http://tcrn.ch/hD830P

1. Achievement

Definition: A virtual or physical representation of having accomplished something. These are often viewed as rewards in and of themselves.

Example: a badge, a level, a reward, points, really anything defined as a reward can be a reward.

2. Appointment Dynamic

Definition: A dynamic in which to succeed, one must return at a predefined time to take some action. Appointment dynamics are often deeply related to interval based reward schedules or avoidance dyanmics.

@jmillerinc
jmillerinc / angel_sim.py
Created April 27, 2010 10:34
Monte Carlo simulation of the payoffs to angel investing
#!/usr/bin/python
#
# Monte Carlo simulation of the payoffs to angel investing.
#
# Assume a pool of N different investors, each investing in D deals,
# with a fixed time horizon and a fixed distribution of payoffs.
# Randomly simulate each investor's total payoff, then compute the
# mean and std dev of all IRRs in the overall pool.
#
# This gives an individual angel an idea of what kind of payoff &