Skip to content

Instantly share code, notes, and snippets.

View nuclearsandwich's full-sized avatar

Steven! Ragnarök nuclearsandwich

View GitHub Profile
@nuclearsandwich
nuclearsandwich / mysqldump_pre_commit_hook.bash
Created April 6, 2011 00:30
A pre-commit hook for git which dumps and adds a mysql database to the repository just before commit.
#!/bin/bash
# Pre-commit hook to make a mysql dump right before committing and add it to the commit.
#
## Change the following values to suit your local setup.
# The name of a database user with read access to the database.
DBUSER=root
# The password associated with the above user. Leave commented if none.
#DBPASS=seekrit
# The database associated with this repository.
DBNAME=dplay
@nuclearsandwich
nuclearsandwich / launch-284.repos
Created August 29, 2019 15:17
external contribution repos file
repositories:
ament/ament_cmake:
type: git
url: https://github.com/ament/ament_cmake.git
version: master
ament/ament_index:
type: git
url: https://github.com/ament/ament_index.git
version: master
ament/ament_lint:
repositories:
ament/ament_cmake:
type: git
url: https://github.com/ament/ament_cmake.git
version: master
ament/ament_index:
type: git
url: https://github.com/ament/ament_index.git
version: master
ament/ament_lint:
@nuclearsandwich
nuclearsandwich / wheel_of_fortune.py
Created May 7, 2013 21:20
CoderDojo Wheel of Fortune Game
###############################FUNCTIONS CREATED BY GROUPS####################################
#INTERMEDIATE GROUP 1
#TAKES A STRING INPUT AND RETURNS A STRING THAT HAS ALL THE
#LETTERS REPLACED WITH DASHES (THE SPACES REMAIN AS SPACES)
def replaceWithDashes(string):
dashes = ""
#fill in here
return dashes
@nuclearsandwich
nuclearsandwich / expand_changes_files.bash
Created September 13, 2018 21:24
Read in an apt .changes file with a compound Distribution: stanza and create copies for each distribution.
expand_changes_files() {
# This function works around https://github.com/aptly-dev/aptly/issues/757
# by expanding each changes file into one changes file per Distribution.
repo=$1
incoming="$HOME/${repo}/incoming"
for changes_file in $(ls $incoming/*.changes); do
changes_basename=$(basename $changes_file)
distributions="$(grep '^Distribution: ' $changes_file | cut -d':' -f2-)"
for dist in $distributions; do
dist_changes_file=$incoming/${dist}_${changes_basename}
@nuclearsandwich
nuclearsandwich / a_look_at_case_expressions.rb
Created July 28, 2011 19:28
A Look at Case Expressions in Ruby
# A Look at Case Expressions in Ruby
# ==================================
#
# *Side note: Playing with docco as a formatting tool for this article. Excuse
# the lines with solitary* `:parabreak` *symbols, they're to make paragraphs on the
# right hand side.*
#
# Ruby, like many languages has a case-when construct for more refined
# conditional execution than if-then-else can provide. Technically all case
# constructs could be written as if-then-else-if-then...else but you wouldn't
import argparse
import datetime
from github import Github, GithubException, GithubObject
github_api_url = 'https://api.github.com'
# label_dict: name, color
repositories:
ament/ament_cmake:
type: git
url: https://github.com/ament/ament_cmake.git
version: master
ament/ament_index:
type: git
url: https://github.com/ament/ament_index.git
version: master
ament/ament_lint:
repositories:
ros2/rviz:
type: git
url: https://github.com/mjbogusz/rviz.git
version: ros2

Keybase proof

I hereby claim:

  • I am nuclearsandwich on github.
  • I am nuclearsandwich (https://keybase.io/nuclearsandwich) on keybase.
  • I have a public key ASBXoKhycQESfwUKsusZMwYz5yCVy0OM-Jv9_9a-jiiHMgo

To claim this, I am signing this object: