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
| const request = require('supertest'); | |
| const app = require('../../app'); | |
| describe('the homepage', () => { | |
| it('returns the correct content', async () => { | |
| const response = await request(app) | |
| .get('/') | |
| .send(); | |
| console.log(response.text); |
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
| const request = require('supertest'); | |
| const app = require('../../app'); | |
| describe('the homepage', () => { | |
| it('returns the correct content', () => { | |
| const response = request(app) | |
| .get('/') | |
| .send(); | |
| console.log(response.text); |
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
| const {assert} = require('chai'); | |
| const {jsdom} = require('jsdom'); | |
| const parseTextFromHTML = (htmlAsString, selector) => { | |
| const selectedElement = jsdom(htmlAsString).querySelector(selector); | |
| if (selectedElement !== null) { | |
| return selectedElement.textContent; | |
| } else { | |
| throw new Error(`No element with selector ${selector} found in HTML string`); | |
| } |
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
| const {assert} = require('chai'); | |
| describe('Array', () => { | |
| describe('.pop()', () => { | |
| it('should return a value and remove the element from the array', () => { | |
| // setup | |
| const foo = [4]; | |
| const includedNumber = 4; | |
| // check setup | |
| assert.include(foo, includedNumber); | |
| // exercise |
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 java.util.ArrayList; | |
| class Playlist { | |
| public static void main(String[] args) { | |
| // creating playlist | |
| ArrayList<String> desertIslandPlaylist = new ArrayList<String>(); | |
| // adding songs to playlist | |
| desertIslandPlaylist.add("Sneaker Pimps - Six Undergound"); |
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
| public class Store { | |
| // instance fields | |
| String productType; | |
| double price; | |
| // constructor method | |
| public Store(String product, double initialPrice) { | |
| productType = product; | |
| price = initialPrice; | |
| } |
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
| public class BankAccount { | |
| public static void main(String[] args){ | |
| double balance = 1000.75; | |
| double amountToWithdraw = 250; | |
| double updatedBalance = balance - amountToWithdraw; | |
| double amountForEachFriend = updatedBalance / 3; | |
| boolean canPurchaseTicket = amountForEachFriend >= 25; | |
| System.out.println(canPurchaseTicket); | |
| System.out.println("I gave each friend " + amountForEachFriend + "..."); | |
| } |
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
| <?php | |
| add_action( 'admin_menu', 'tnew_plugin_add_admin_menu' ); | |
| add_action( 'admin_init', 'tnew_plugin_settings_init' ); | |
| function tnew_plugin_add_admin_menu( ) { | |
| add_menu_page( 'Site Bilgilerini Ayarla', 'Site Bilgileri', 'manage_options', 'tnew_theme', 'tnew_plugin_options_page' ); | |
| } |
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
| <?php | |
| /** | |
| * The template for displaying archive pages for all posts | |
| * | |
| */ | |
| get_header(); ?> | |
| <div class="wrap"> |
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
| public class MainActivity extends Activity { | |
| public void onCreate(Bundle savedInstanceState) { | |
| super.onCreate(savedInstanceState); | |
| setContentView(R.layout.activity_main); | |
| // Create new helper | |
| DatabaseHelper dbHelper = new DatabaseHelper(getContext()); | |
| // Get the database. If it does not exist, this is where it will | |
| // also be created. | |
| SQLiteDatabase db = dbHelper.getWriteableDatabase(); |