Skip to content

Instantly share code, notes, and snippets.

View avgerin0s's full-sized avatar

Aggelos Avgerinos avgerin0s

  • Skroutz S.A.
  • Athens, Greece
View GitHub Profile
use io::println;
fn main() {
println("Hello, world.");
}
require 'net/http'
require 'net/https'
gist = {
"description" => "wat",
"public" => false,
"files" => {
"popme_backup" => {
"content" => "wat"
}
require 'minitest/autorun'
class CaptureIoTest < MiniTest::Unit::TestCase
def test_puts
out, err = capture_io do
puts "hey"
end
assert_equal "hey\n", out
end
@avgerin0s
avgerin0s / cron
Created April 29, 2013 08:45
cron cheatsheet
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .----- day of week (0 - 7) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * command to be executed
class Calc
# Creates getters and setters for num1 and num2
attr_accessor :num1, :num2
def initialize(num1, num2)
@num1 = num1
@num2 = num2
end
import org.junit.*;
import java.util.*;
import play.test.*;
import models.*;
public class BasicTest extends UnitTest {
@Before
public void setup() {
Fixtures.deleteDatabase();
if Rails.env.development? || Rails.env.test?
get '/getmein' => 'users#getmein'
end
...
def getmein
@user = User.where(username: "ausername").first
authentication = Authentication.where(user_id: @user.id, provider: "github").first
sign_in_and_redirect(:user, authentication.user)
end
...
@avgerin0s
avgerin0s / dabblet.css
Created February 27, 2013 16:24
Untitled
input, select, textarea {
display: block;
margin: 10px;
}
textarea {
resize: none;
}
@avgerin0s
avgerin0s / dabblet.css
Created February 27, 2013 15:09
Untitled
img {
display: block;
}
table, tr, th {
border: 3px solid black;
text-align: center;
color: purple;
}