Skip to content

Instantly share code, notes, and snippets.

// I properly indented the code. It is very important to indent correctly
// because it makes the code much more readable.
public class Palindrome
{
private boolean s;
// Why is this boolean and not string? From the assignment: "The Palindrome
// class should define a single String field."
public class Palindrome
{
private String pal;
public Palindrome()
{
pal = " ";
}
@danrue
danrue / arraylist.java
Created April 16, 2012 02:10 — forked from anonymous/arraylist
Array of primitive class
import java.util.Scanner;
import java.io.*;
public class Scores
{
private final int MAX=20;
private int[] scores = new int[MAX];
private int inUse = 0;
@danrue
danrue / arrayobjects
Created April 16, 2012 02:26 — forked from anonymous/arrayobjects
car array
public class Car2
{
private int yearModel; // The car's year model
private String make; // The car's make
private int speed; // The car's speed
private String license; // The car's license
/**
* Constructor that initializes the model, make and speed of the car.
*
@danrue
danrue / make_keydir.sh
Created August 9, 2012 20:46
gitolite key scraper
#!/bin/sh
# Script to generate a gitolite style key directory from existing
# authorized_keys files. Supports multiple key files.
#
# IN: /home/*/.ssh/authorized_keys files
# OUT:
# keydir/
# keydir/user1
# keydir/user1/1/user.pub
#!/bin/sh
# Script to generate a gitolite style key directory from existing
# authorized_keys files. Supports multiple key files.
#
# IN: /home/*/.ssh/authorized_keys files
# OUT:
# keydir/
# keydir/user1
# keydir/user1/1/user.pub
@danrue
danrue / gist:4060713
Created November 12, 2012 17:32
gitolite config causing split conf
@repogroup1 = official/apitests
@repogroup1 = official/atlas
@repogroup1 = official/automation
repo @repogroup1
config hooks.customhook = true
config hooks.customhookproject = Fun Project Label
config hooks.mailenabled = false
RWCDM = nouser
@danrue
danrue / gist:4208106
Created December 4, 2012 20:04
Gitolite perms deletes description - bug
# gitolite perms command appears to remove any previously set description files. To recreate,
# * run the gitolite test suite
# * add wild repos using the config below
# * create a wild repo
# * set a description
# * set a perm
# * check the description
# Set up environment
$ GITOLITE_TEST=y prove t/ssh*
#!/bin/sh
webhooks=$(git config hooks.webhooks)
while read LINE; do
# Hit any webhooks if configured
if [ -n "${webhooks}" ]; then
for webhook in ${webhooks}; do
echo "Notifying $(echo ${webhook} | awk -F / '{print $3}')"
# Given the permissions for @all repos,
# How can I restrict W access to repo foo?
repo @all
option deny-rules = 1
RWCDM = nouser
RWC = @branch_and_taggers
RW = @all
repo foo