Skip to content

Instantly share code, notes, and snippets.

#include <cmath>
#include "ListenElement2.h"
class Liste
{
public:
Liste()
{
head = NULL;
tail = NULL;
@AVGP
AVGP / LineDemo
Created February 5, 2011 01:00
A dotted line
;
; Zeichnet 80 Pixel in einer gepunkteten Linie
; Die Linie besteht aus 10 Segmenten a 8 Pixeln.
;
#include "../ti83plus.inc"
.db $BB,$6D
.org 9D95h
.db t2ByteTok
ld a,10 ;Zähler
ld b,0 ;Koordinate
@AVGP
AVGP / hello.asm
Created February 5, 2011 17:10
Hello, TI 83+!
#include "../ti83plus.inc"
.db $BB,$6D
.org 9D95h
.db t2ByteTok
ld hl,txtHello
bcall(_puts)
ret
txtHello:
.db "Hello TI",0
.end
# gem sources -u
ERROR: http://gems.rubyforge.org/ does not appear to be a repository
ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
bad response Found 302 (http://gems.rubyforge.org/yaml)
@AVGP
AVGP / test.rb
Created April 10, 2011 00:27
Just a small OOP-Hello-World-alike in Ruby
#!/usr/bin/ruby
class GrussAugust
attr_accessor :name
def initialize(name = "World")
@name = name
end
def greet
describe "IntelligentForwardings" do
describe " on unauthorized access" do
it "should redirect back to original page" do
user = Factory(:user)
visit edit_user_path(user)
#Redirect 1: To the login path
fill_in :email, :with => user.email
fill_in :password, :with => user.raw_password
click_button
#Redirect 2: Back to edit path
@AVGP
AVGP / matrix.css
Created January 30, 2012 00:25
matrix.js allows easy creation of an animated matrix-style background with JavaScript and CSS.
div.matrix {
color: #060;
position: absolute;
font-family: mono-space, sans-serif;
font-size: 10px;
top: 5px;
left: 10px;
z-index: 2;
width: 99%;
overflow: hidden;
@AVGP
AVGP / langdetect.class.php
Created February 7, 2012 19:09
A class to detect the language of a text (supports German/English but can be extended)
class LangDetect {
protected $dict = array(
'German' => array('ich','du','er','sie','es','wir','ihr','sie','der','die','das'),
'English' => array('i','you','he','she','it','we','us','they','this', 'the', 'a')
);
protected $sourceText;
public function __construct($text) {
$this->sourceText = $text;
}
describe "Users" do
describe "Sign up" do
describe "with invalid data" do
it "should not create user" do
lambda do
visit signup_path
fill_in "Name", :with => ""
fill_in "Email", :with => ""
fill_in "Password", :with => ""
fill_in "Confirm password", :with => ""
@AVGP
AVGP / rspec_user.rb
Created April 18, 2012 19:12
RSpec example
describe "Users" do
describe "Sign up" do
describe "with invalid data" do
it "should not create user" do
lambda do
visit signup_path
fill_in "Name", :with => ""
fill_in "Email", :with => ""
fill_in "Password", :with => ""
fill_in "Confirm password", :with => ""