Skip to content

Instantly share code, notes, and snippets.

View mbbx6spp's full-sized avatar
🎯
Focusing

Susan Potter mbbx6spp

🎯
Focusing
View GitHub Profile
@mbbx6spp
mbbx6spp / pdsh.md
Last active October 28, 2024 14:04
Tutorial on pdsh. I am revising this for pdsh from my previous tutorial on dsh from 2013 found here: https://gist.github.com/mbbx6spp/6181003

Parallel Distributed SHell (pdsh)

Similar to ansible command but allows you to use any command that will work in your shell. Not tied to specific configuration management tooling, just SSH and your default shell on remote systems. Just works. I <3 it :)

What does it do?

Runs commands across potentially many machines. Allows you to organize your servers/VMs/instances into groups very easily.

@mbbx6spp
mbbx6spp / README.md
Last active October 22, 2024 13:13
Gerrit vs Github for code review and codebase management

Gerrit vs Github: for code review and codebase management

Sure, Github wins on the UI. Hands down. But, despite my initial annoyance with Gerrit when I first started using it almost a year ago, I am now a convert. Fully. Let me tell you why.

Note: This is an opinionated (on purpose) piece. I assume your preferences are like mine on certain ideas, such as:

  • Fast-forward submits to the target branch are better than allowing merge commits to the target branch. The reason I personally prefer this is that, even if a non-conflicting merge to the target branch is possible, the fact that the review/pull request is not up to date with the latest on the target branch means feature branch test suite runs in the CI pipeline reporting on the review/PR may not be accurate. Another minor point is that forced merge commits are annoying as fuck (opinion) and clutter up Git log histories unnecessarily and I prefer clean histories.
  • Atomic/related changes all in one commit is something worth striving for. Having your dev
@mbbx6spp
mbbx6spp / capistrano-memcached.rb
Last active October 20, 2024 14:38
Memcached Capistrano tasks
# 2007 Copyright Susan Potter <me at susanpotter dot net>
# You can read her software development rants at: https://www.susanpotter.net/software/
# Released under CreativeCommons-attribution-noncommercial-sharealike license:
# http://creativecommons.org/licenses/by-nc-sa/1.0/
namespace :memcached do
desc "Restart the Memcache daemon"
task :restart, :roles => :app do
deploy.memcached.stop
deploy.memcached.start
end
@mbbx6spp
mbbx6spp / Types.purs
Last active October 20, 2024 14:35
Accompanying PureScript demonstration of native ADTs for the 'Algebraic Data Types in PureScript': https://www.susanpotter.net/software/algebraic-data-types-in-typescript/
module Main (main) where
import Data.Unit (Unit)
import Data.Maybe (Maybe (..))
import Effect (Effect)
import Effect.Console (log)
main :: Effect Unit
main = log "hello world"
@mbbx6spp
mbbx6spp / balance_sheet.coffee
Last active October 20, 2024 14:32
Balance sheet object model example to demonstrate CoffeeScript and translated Javascript.
# Creative Commons Attribution-Share Alike 3.0 United States License
# http://creativecommons.org/licenses/by-sa/3.0/us/
# By Susan Potter <https://www.susanpotter.net/software/>
class BalanceSheet
constructor: (companyName, date) ->
@companyName: companyName
@date: date
@assets: []
@liabilities: []
entries: ->
@mbbx6spp
mbbx6spp / .gitconfig
Last active October 20, 2024 14:32
Susan Potter's .gitconfig file from November 2007 blog post. Updated since November 2007 with new aliases or options.
# Migrating my old .gitconfig blog post from 2007 to here so I can update it easier.
# Original URL:
# https://www.susanpotter.net/snippets/my-.gitconfig-.tigrc-files/
[user]
name = Susan Potter # make sure you change this
email = me@susanpotter.net # make sure you change this
[color]
diff = auto
status = auto
branch = auto
@mbbx6spp
mbbx6spp / simple_math.coffee
Last active October 20, 2024 14:31
Simple math CoffeeScript example translated to Javascript.
# Creative Commons Attribution-Share Alike 3.0 United States License
# http://creativecommons.org/licenses/by-sa/3.0/us/
# By Susan Potter <https://www.susanpotter.net/software/>
(() ->
window: this
window.SimpleMath: {
square: (x) ->
x*x
cube: (x) ->
x*x*x
@mbbx6spp
mbbx6spp / page.coffee
Last active October 20, 2024 14:30
jQuery API usage example in CoffeeScript translated to Javascript.
# Creative Commons Attribution-Share Alike 3.0 United States License
# http://creativecommons.org/licenses/by-sa/3.0/us/
# By Susan Potter <https://www.susanpotter.net/software/>
(($) ->
editSubmitHandler: (evt) ->
form: $(this)
data: form.serialize()
url: form.attr('action')
$.getJSON(url, data, (data, resp) ->
$('#notice').html(data['html'])
@mbbx6spp
mbbx6spp / capistrano_git_tasks.rb
Last active October 20, 2024 14:30
Git (submodule) Capistrano tasks
# 2009 Copyright Susan Potter <me at susanpotter dot net>
# You can read her software development rants at: https://www.susanpotter.net/software/
# Released under CreativeCommons-attribution-noncommercial-sharealike license:
# http://creativecommons.org/licenses/by-nc-sa/1.0/
namespace :git do
namespace :submodule do
desc "Initializes submodules"
task :init, :roles => :app do
invoke_command "cd #{current_path} && git submodule init", :via => run_method
end
/* 2009-2010 (c) Copyright Susan Potter. https://www.susanpotter.net/software/ */
/* Released under MIT License. */
/* Example using node.js */
(function () {
var sys = require('sys');
var http = require('http');
const PORT = 8080;
http.createServer(function (req, res) {