This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use io::println; | |
| fn main() { | |
| println("Hello, world."); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'net/http' | |
| require 'net/https' | |
| gist = { | |
| "description" => "wat", | |
| "public" => false, | |
| "files" => { | |
| "popme_backup" => { | |
| "content" => "wat" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # .---------------- 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Calc | |
| # Creates getters and setters for num1 and num2 | |
| attr_accessor :num1, :num2 | |
| def initialize(num1, num2) | |
| @num1 = num1 | |
| @num2 = num2 | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import org.junit.*; | |
| import java.util.*; | |
| import play.test.*; | |
| import models.*; | |
| public class BasicTest extends UnitTest { | |
| @Before | |
| public void setup() { | |
| Fixtures.deleteDatabase(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if Rails.env.development? || Rails.env.test? | |
| get '/getmein' => 'users#getmein' | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ... | |
| 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 | |
| ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| input, select, textarea { | |
| display: block; | |
| margin: 10px; | |
| } | |
| textarea { | |
| resize: none; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| img { | |
| display: block; | |
| } | |
| table, tr, th { | |
| border: 3px solid black; | |
| text-align: center; | |
| color: purple; | |
| } |