Skip to content

Instantly share code, notes, and snippets.

View arthurschreiber's full-sized avatar

Arthur Schreiber arthurschreiber

View GitHub Profile
$:.unshift File.expand_path("../lib", __FILE__)
require 'rugged'
repo = Rugged::Repository.init_at('./test-repo')
index = repo.index
base_commit_options = {
author: { name: "Matt", email: "matt@test.com" },
require 'rugged'
repo = Rugged::Repository.init_at('./test-repo')
index = repo.index
base_commit_options = {
author: { name: "Matt", email: "matt@test.com" },
committer: { name: "Matt", email: "matt@test.com" },
update_ref: 'HEAD'
<?php
namespace FsckUnit;
require_once(dirname(__FILE__) . "/spec_helper.php");
describe("ActiveRecord::Base::table_name()", function() {
it("returns the table name for the class", function() {
expect(::News::table_name())->to("==", "news");
expect(::Post::table_name())->to("==", "posts");
ActiveSupport::ArrayExtensions::flatten()
- should correctly flatten the passed multi-dimensional arrays down to a single-dimensional array
- should correctly flatten associative arrays
ActiveSupport::ArrayExtensions::first()
- should return the first item of the passed array
ActiveSupport::ArrayExtensions::last()
- should return the last item of the passed array
ActiveSupport::ArrayExtensions::flatten()
- should correctly flatten the passed multi-dimensional array down to a single-dimensional array
- should correctly flatten associative arrays
ActiveSupport::ArrayExtensions::first()
- should return the first item of the passed array
ActiveSupport::ArrayExtensions::last()
- should return the last item of the passed array
<?php
namespace FsckUnit;
class Bowling
{
public $score = 0;
public function hit()
{

You can "force" commands to be run on a login for a specific user in ~/.ssh/authorized_keys

To always run the /home/deployuser/deploy.sh command:


command="DEPLOY_USER='arthur.schreiber@hp.com' /home/deploy/deploy.sh $SSH_ORIGINAL_COMMAND",no-agent-forwarding,no-user-rc,no-X11-forwarding,no-port-forwarding" ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA1JnkxQDucKWOAD8QsmAVlXT0trq/QmtKeGkL+a6QUvctKBpe8qLuYUyGEgn+GvGwP9IqDZPYXBP0andFvim+40QKworx9oALuIei5rIWM3fCIbY0lTdM6gZVgTdYBNryW5axeuwsXjuT/i5lE+lA1JxQ5LjTq7n5gbT8tus4FbHySSkmrWmoz9rh8m9bULnmGquDQw6+xCbPFteVUhEDRsCsmlUldLMatMDuQ5hnhz0mKU41sqs+EPtmYh6pG/ofpyURMsR7/C/Rf1/i6AB9Mb3WqQOGE2x3cj+sj0vILiuHsnEx32qpNDvqrE+scRjcRsKIiaTSD4jqO9Mws5Ob7w==

command="DEPLOY_USER='arthur.schreiber@hp.com' /home/deploy/deploy.sh $SSH_ORIGINAL_COMMAND",no-agent-forwarding,no-user-rc,no-X11-forwarding,no-port-forwarding" <jenkins pub>
command="DEPLOY_USER='arthur.schreiber@hp.com' /home/deploy/deploy.sh $SSH_ORIGINAL_COMMAND",no-agent-forwarding,no-user-rc,no-X11-forwarding,no-port
puts "Hallo wie ist ihr Name?"
@name = gets.chomp
puts "WIr werden jetzt herausfinden ob sie\n-zu dick\n-zu dünn\n-oder genau richtig sind."
def hallo
puts "Geben sie bitte ihr Gewicht."
@gewicht = gets.chomp
puts "Geben sie bitte ihre Groese in >>METERN<< ein."
@groese = gets.chomp
puts "#{@name}, sie sind #{@groese} Groß und wiegen #{@gewicht}.\n Ist das richtig?\n"
class BMIRechner
def initialize()
puts "Hallo wie ist ihr Name?"
@name = gets.chomp
puts "WIr werden jetzt herausfinden ob sie\n-zu dick\n-zu duenn\n-oder genau richtig sind."
self.hallo()
end
def hallo
$KCODE = "UTF-8"
class BmiRechner
def initialize
self.get_name
puts "WIr werden jetzt herausfinden ob sie\n-zu dick\n-zu duenn\n-oder genau richtig sind."
end
def get_wert(frage)
puts(frage)