Skip to content

Instantly share code, notes, and snippets.

@cdnsteve
cdnsteve / name_to_email_lookup.js
Created September 19, 2024 18:48
App Script that looks up users email address in gmail by name
function lookupEmails() {
// Replace 'Sheet1' with your actual sheet name
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Sheet1');
var namesRange = sheet.getRange('A2:A'); // Adjust to your names column range
var names = namesRange.getValues();
// Iterate over the names
for (var i = 0; i < names.length; i++) {
if (names[i][0] !== '') { // If there's a name in the cell
var userEmail = getUserEmailByName(names[i][0]);
@cdnsteve
cdnsteve / boots_and_cats.py
Created December 20, 2019 02:31
Python boots and cats text to audio - works offline!
import pyttsx3
engine = pyttsx3.init()
rate = engine.getProperty('rate')
first_saying = 'And now for: boots and cats'
repeat_saying = 'and boots and cats '
engine.say(first_saying)
engine.setProperty('rate', 360)
@cdnsteve
cdnsteve / docker_commands.md
Last active February 22, 2016 17:37
Docker Commands
@cdnsteve
cdnsteve / fizzbuzz.go
Created April 12, 2015 18:53
Fizz Buzz example using Go Lang
// Copyright 2015 Steven Leggett. All rights reserved.
package main
import "fmt"
func main() {
const (
x string = "Go Lang Fizz Buzz"
v string = "1.0.0"
@cdnsteve
cdnsteve / install_postgre.sh
Last active August 29, 2015 14:17
Ruby Python and Postgre install
From http://stackoverflow.com/questions/1383126/django-python-beginner-error-when-executing-python-manage-py-syncdb-psycopg2
Just had to unlink postgreSQL
`brew unlink postgresql`
then
`xcode-select --install`
and finally
`brew install postgresql`
@cdnsteve
cdnsteve / drush_command
Created November 13, 2014 19:22
Drush Modules Enabled List
drush pm-list --type=Module --status=enabled
@cdnsteve
cdnsteve / github_improvements.md
Created September 17, 2014 16:29
Github Improvements for Devs

Github Improvements for Devs

Suggestions to make Github better.

  1. /issues need to remember your filters. Changing Milestones every time you view /issues and other flags drives me crazy.
  2. Wiki search. Under the /wiki, the right hand column called Pages lets you search titles. When your wiki grows and grows we need to search content of pages. Great search makes for finding documentation faster.
  3. Wiki content, search as you type for files in codebase so you can easily reference source code. Or even have something like :source filename.ext
  4. Better issue management. For large projects, organizing issues is starting to get too out of control. We have been using Kanban board like Huboard to help prioritize issues. I know others use things like Trello.
<?php
// We assume that this script is being executed from the root of the Drupal
// installation. e.g. ~$ `phpunit TddTests sites/all/modules/tdd/TddTests.php`.
// These constants and variables are needed for the bootstrap process.
define('DRUPAL_ROOT', getcwd());
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
$_SERVER['REMOTE_ADDR'] = '127.0.0.1';
language: php
#
# Important to note, this is the version of PHP used to run this build, not the
# one used to run your Drupal installation. Ensure compatibility with the Drush
# and Terminus versions you're using for this build.
#
php:
- 5.3
@cdnsteve
cdnsteve / jquery_rollovers.js
Created January 29, 2014 03:27
jQuery Rollovers
/**
* Image RollOver Effect
* ========================================================================
*/
jQuery(".rollover").hover(
function () {
var iconName = jQuery(this).attr("src");
var rollover = iconName.replace( /active/, 'rollover' );
jQuery(this).attr({ src: rollover });
},