Skip to content

Instantly share code, notes, and snippets.

cdnsteve /
Created Dec 20, 2019
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.setProperty('rate', 360)
cdnsteve / fizzbuzz.go
Created Apr 12, 2015
Fizz Buzz example using Go Lang
View fizzbuzz.go
// 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 /
Last active Aug 29, 2015
Ruby Python and Postgre install
Just had to unlink postgreSQL
`brew unlink postgresql`
`xcode-select --install`
and finally
`brew install postgresql`
cdnsteve / drush_command
Created Nov 13, 2014
Drush Modules Enabled List
View drush_command
drush pm-list --type=Module --status=enabled
cdnsteve /
Created Sep 17, 2014
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.
View TddTests.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/';
View .travis.yml
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.
- 5.3
View jquery_rollovers.js
* Image RollOver Effect
* ========================================================================
function () {
var iconName = jQuery(this).attr("src");
var rollover = iconName.replace( /active/, 'rollover' );
jQuery(this).attr({ src: rollover });
cdnsteve / number_formatter.php
Created Jan 15, 2014
PHP Number converter - converts any number format (English, French, Strings, ints) and returns double (float)
View number_formatter.php
function validateCleanPrice($num) {
$cleanString = preg_replace('/([^0-9\.,])/i', '', $num);
$onlyNumbersString = preg_replace('/([^0-9])/i', '', $num);
$separatorsCountToBeErased = strlen($cleanString) - strlen($onlyNumbersString) - 1;