Skip to content

Instantly share code, notes, and snippets.

View iTrauco's full-sized avatar

Christopher Trauco iTrauco

View GitHub Profile
@fabiorecife
fabiorecife / sendMailGoogleAppsScript
Created April 11, 2012 14:17
send mail with google apps script
function sendMailAvaliacaoFicha() {
var sheet = SpreadsheetApp.getActiveSheet();
var startRow = 2; // First row of data to process
var numRows = 9; // Number of rows to process
// Fetch the range of cells A2:F10
var dataRange = sheet.getRange(startRow, 1, numRows, 6)
// Fetch values for each row in the Range.
var data = dataRange.getValues();
for (i in data) {
var row = data[i];
@sirleech
sirleech / gist:2660189
Created May 11, 2012 14:42
Python Read JSON from HTTP Request of URL
# Load Json into a Python object
import urllib2
import json
req = urllib2.Request("http://localhost:81/sensors/temperature.json")
opener = urllib2.build_opener()
f = opener.open(req)
json = json.loads(f.read())
print json
print json['unit']
@zenorocha
zenorocha / README.md
Last active March 11, 2026 14:24
A template for Github READMEs (Markdown) + Sublime Snippet

Project Name

TODO: Write a project description

Installation

TODO: Describe the installation process

Usage

@zatarra
zatarra / jks-certificate-expiry-checker.sh
Last active February 12, 2023 07:16
Small script to check the expiry of all the certificates inside a java keystore.
#!/bin/sh
########################################################
#
# Check certificates inside a java keystore
#
########################################################
TIMEOUT="timeout -k 10s 5s "
KEYTOOL="$TIMEOUT keytool"
THRESHOLD_IN_DAYS="30"
@mogsdad
mogsdad / Google Apps Script Survey Workflow.md
Last active August 1, 2022 07:48
Google Apps Script workflow for an email survey. Written in response to StackOverflow question 18668828. http://stackoverflow.com/a/18669532/1677912

Google Apps Script Survey Workflow

The components involved in this workflow are:

  • A script to generate and send an email with an HTML form.
  • An html template for that email, which allows us to customize the email for each recipient.
  • A doPost() function to handle responses. The script must be [deployed as a Web App][1].
  • A spreadsheet to collect responses. The script will be contained in the spreadsheet, and extends the spreadsheet UI with a menu for sending a copy of the survey. (It could be adapted for standalone use, without the UI component.)

Here is an example of such a workflow, conducting a Commuting Survey. Recipients will receive a survey email like this:

@lrhache
lrhache / python-selenium-open-tab.md
Last active May 15, 2026 18:47
Python Selenium - Open new tab / focus tab / close tab

On a recent project, I ran into an issue with Python Selenium webdriver. There's no easy way to open a new tab, grab whatever you need and return to original window opener.

Here's a couple people who ran into the same complication:

So, after many minutes (read about an hour) of searching, I decided to do find a quick solution to this problem.

@simonista
simonista / .vimrc
Last active June 17, 2026 10:11
A basic .vimrc file that will serve as a good template on which to build.
" Don't try to be vi compatible
set nocompatible
" Helps force plugins to load correctly when it is turned back on below
filetype off
" TODO: Load plugins here (pathogen or vundle)
" Turn on syntax highlighting
syntax on
@zsup
zsup / ddd.md
Last active June 9, 2026 18:24
Documentation-Driven Development (DDD)

Documentation-Driven Development

The philosophy behind Documentation-Driven Development is a simple: from the perspective of a user, if a feature is not documented, then it doesn't exist, and if a feature is documented incorrectly, then it's broken.

  • Document the feature first. Figure out how you're going to describe the feature to users; if it's not documented, it doesn't exist. Documentation is the best way to define a feature in a user's eyes.
  • Whenever possible, documentation should be reviewed by users (community or Spark Elite) before any development begins.
  • Once documentation has been written, development should commence, and test-driven development is preferred.
  • Unit tests should be written that test the features as described by the documentation. If the functionality ever comes out of alignment with the documentation, tests should fail.
  • When a feature is being modified, it should be modified documentation-first.
  • When documentation is modified, so should be the tests.
@mderazon
mderazon / export-to-csv.gs
Last active October 9, 2025 17:55
Google apps script to export to individual csv files all sheets in an open spreadsheet
/*
* script to export data in all sheets in the current spreadsheet as individual csv files
* files will be named according to the name of the sheet
* author: Michael Derazon
*/
function onOpen() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var csvMenuEntries = [{name: "export as csv files", functionName: "saveAsCSV"}];
ss.addMenu("csv", csvMenuEntries);
@iods
iods / basic.html
Last active November 18, 2022 03:31
Markup for boilerplate HTML files based on Acuity.
<!DOCTYPE html>
<!--[if IE 6]> <html class="ie6 no-js" lang="en-US" prefix=""><![endif]-->
<!--[if lt IE 7]> <html class="ie ie6 lte9 lte8 lte7 no-js" lang="en-US" prefix=""><![endif]-->
<!--[if IE 7]> <html class="ie ie7 lte9 lte8 lte7 no-js" lang="en-US" prefix=""> <![endif]-->
<!--[if IE 8]> <html class="ie ie8 lte9 lte8 no-js" lang="en-US" prefix=""><![endif]-->
<!--[if IE 9]> <html class="ie ie9 lte9 no-js" lang="en-US" prefix=""><![endif]-->
<!--[if gt IE 9]> <html class="gtie9 ie9 no-js" lang="en-US" prefix=""><![endif]-->
<!--[if !IE]> <html class="not-ie no-js" lang="en-US" prefix=""><![endif]-->
<head itemscope itemtype="http://schema.org/WebSite">
<meta charset="utf-8">