Skip to content

Instantly share code, notes, and snippets.

Avatar
🛠️
Creating

Geoffrey Grosenbach topfunky

🛠️
Creating
View GitHub Profile
View high-contrast.r
# As seen at https://topfunky.com/2021/ggplot-high-contrast-theme-gghighcontrast/
foreground_color = "white"
background_color = "black"
ggplot(data,
aes(
x = year,
y = revenue,
group = product,
View add-mozilla-public-license.sh
#!/usr/bin/env sh
# Download the Mozilla Public License 2.0 and commit it to the current repository.
#
# Author: Geoffrey Grosenbach <geoffrey@hashicorp.com>
# Date: August 16, 2021
curl https://www.mozilla.org/media/MPL/2.0/index.48a3fe23ed13.txt -o LICENSE.txt
git add LICENSE.txt
@topfunky
topfunky / README.md
Last active Feb 28, 2021 — forked from kaitlincart/README.md
Technical Editor Project
View README.md

This is a technical writing and editing project as part of your interview.

This project is designed to take less than 1.5 - 2 hours.

Read the style guide snippet which is a subset of our official engineering style guide and the guide template. Then make improvements to the sample prose so it embodies the principles in the style guide.

Instructions

  • Create a git repository on GitHub, GitLab, Bitbucket, or any other git hosting service.
  • Download the original terraform-getting-started.md file by clicking the "Raw" button.
@topfunky
topfunky / troubleshooting.md
Created Oct 10, 2012
Troubleshooting chef-solo
View troubleshooting.md

Troubleshooting chef-solo

Re: PeepCode screencast on Meet Chef

  • Is the VM running? Try vagrant up
  • Can you connect to the VM? Try vagrant ssh
  • Did chef-solo -j /etc/chef/node.json run without error?
  • Did chef-solo install the nginx package? You should see Run List is [recipe[nginx]]
  • Is Nginx running on the VM? Try ps aux | grep nginx
  • Does the webserver respond on the VM? Run curl -I http://localhost from inside the VM. You should see Server: nginx in the output.
@topfunky
topfunky / duplicate-finder-window.applescript
Created Aug 24, 2012
Make a new Finder window open to the same directory as the current one.
View duplicate-finder-window.applescript
(*
Duplicate current Finder window
Author: Barry Els
Version: 1.1
*)
try
tell application "Finder"
set this_folder to (the target of the front window) as alias
@topfunky
topfunky / CHANGES.md
Created Aug 2, 2012
Express 3.0 Changes
View CHANGES.md

Changes in Express 3.0 Templates

Related: PeepCode Full Stack Node.js screencast (an included code sample works with Express 3.0).

There are several syntax changes in Express 3.0. They do require modifications to your code, but they aren't too complicated.

The biggest change is that Express templates now use Django style inheritance rather than ERB/Rails style automatic layouts.

Summary

@topfunky
topfunky / instanceof-example.js
Created Mar 22, 2012
example of using instanceof
View instanceof-example.js
// NOTE: `app` parameter is an instance of Express.js.
module.exports = function(app) {
var socketIO;
socketIO = require('socket.io').listen(app);
socketIO.sockets.on('connection', function(socket) {
console.log("CONNECTED");
console.log(socket instanceof socket.constructor);
});
};
View knights-tour-test.coffee
vows = require 'vows'
assert = require 'assert'
class Board
class Tour
constructor: ->
@board = new Board
suite = vows.describe('KnightsTour')
@topfunky
topfunky / Cakefile
Created Feb 11, 2012
Run tasks sequentially in a Cakefile
View Cakefile
task 'sample_task', sample_task = (callback) ->
doSomethingAndRunCallbackAfter callback
task 'setup', 'All: Import all data and run webserver', ->
tasks = [install, pre_populate, populate_couch, graph_sync, server]
runSequentially = (currentTask, otherTasks...) ->
currentTask ->
if otherTasks.length
runSequentially otherTasks...
runSequentially tasks...
@topfunky
topfunky / duration.coffee
Created Aug 31, 2011
A custom Batman.js filter
View duration.coffee
# Transform an integer number of seconds as hours and minutes: 1:45
#
# Put in filters/duration.coffee and do @require('filters', 'duration')
Batman.Filters.formatSecondsAsTime = (value) ->
seconds = parseInt value, 10
return '' unless seconds
hours = parseInt seconds / 60 / 60, 10
minutes = parseInt (seconds / 60) % 60, 10
hours = '' unless hours > 0
minutes = '0' + minutes if minutes < 10