Skip to content

Instantly share code, notes, and snippets.

@tbuehlmann
tbuehlmann / app.rb
Last active December 11, 2015 11:48 — forked from troelskn/app.rb
require 'gollum/frontend/app'
require 'digest/sha1'
User = Struct.new(:name, :email, :password_hash)
class App < Precious::App
configure do
set :authorized_users, []
settings.authorizes_users << User.new('peter', '[email protected]', Digest::SHA1.hexdigest('pw'))
settings.authorizes_users << User.new('andrew', '[email protected]', Digest::SHA1.hexdigest('another_pw'))
@tbuehlmann
tbuehlmann / gist:5195811
Last active December 15, 2015 03:39 — forked from TvL2386/gist:5195772
require 'popen4'
class Exec
attr_reader :stdout
attr_reader :stderr
attr_reader :status
attr_reader :failure
def initialize *args
@stdout = nil
import java.util.Scanner;
class dreizehn4
{
public static void main (String[] args)
{
Scanner in=new Scanner(System.in);
int str=42,life=42,luck=42;
String name;
boolean a=false;
class gridtest1
{
public static void main (String[] args)
{
int i=0,j=0,grid=10;
while(i<=grid)
{
while(j<=grid)
{
Write a program that reads a text file that contains groups of integers
that start with the word "next". For each group, the program computes and writes out
the sum of integers in that group. There may be any number of groups. Example data set:
5 89
next
1 1 1 1 1 1
next
next
1 1 1 1 1 1 1 1 1
@tbuehlmann
tbuehlmann / app.rb
Last active December 16, 2015 09:39 — forked from banister/app.rb
class SprocketsMiddleware
attr_reader :app, :prefix, :sprockets
def initialize(app, prefix)
@app = app
@prefix = prefix
@sprockets = Sprockets::Environment.new
yield sprockets if block_given?
end
@tbuehlmann
tbuehlmann / PrintX.java
Last active December 16, 2015 15:09 — forked from anonymous/PrintX.java
class PrintX {
public void print(String input, int i) {
for(int j=1; j<=i; j++) {
System.out.println(input);
}
}
public static void main(String[] args) {
PrintX p = new PrintX();
p.print("foo", 3);
class HelloTestObject {
String st;
HelloTestObject(String st) {
this.st = st;
}
void speak() {
System.out.println(st);
}
class HelloObject
{
String greeting;
HelloObject(String st)
{
greeting=st;
}
HelloObject(HelloObject obj)
{
import java.util.Scanner;
class Car {
//instance variables
double start, end, galls;
//constructor
Car(double start, double end, double galls) {
this.start = start;
this.end = end;