Skip to content

Instantly share code, notes, and snippets.

@kkganesan
kkganesan / history.component.spec.ts
Created September 17, 2023 19:38 — forked from achimoraites/history.component.spec.ts
Advanced Angular Testing with Jasmine
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { HistoryComponent } from './history.component';
fdescribe('HistoryComponent', () => {
let component: HistoryComponent;
let fixture: ComponentFixture<HistoryComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
@kkganesan
kkganesan / streams_with_async.dart
Created January 19, 2020 20:20 — forked from mjohnsullivan/streams_with_async.dart
Example of how to transform streams of data in Dart/Flutter when the transform involves asynchronous calls.
import 'dart:async';
import 'dart:math' show Random;
final random = Random();
// Mock data for a list of messages
const messageList = [
{
'message': 'Message 1',
'timestamp': 1,
@kkganesan
kkganesan / book_list.dart
Created January 19, 2020 20:19 — forked from mjohnsullivan/book_list.dart
A simple book list Flutter example using the Google Books API
/*
Copyright 2018 The Chromium Authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
// App
import { Component } from '@angular/core';
@Component({
selector: 'app',
template: '<span>{{ sayHello() }}</span>',
})
export class App {
public name: string = 'John';
@kkganesan
kkganesan / adapters.application.js
Created July 24, 2016 20:22
Product With Books
import DS from 'ember-data';
export default DS.FixtureAdapter.extend();
@kkganesan
kkganesan / save_screenshots_snippets.rb
Created December 17, 2011 17:20 — forked from tommeier/save_screenshots_snippets.rb
Save screenshots when using Selenium, Capybara and Ubuntu server
#WIP
#spec/spec_helper.rb
RSpec.configure do |config|
#Only for selenium based tested filtered with :js => true on tests
#eg: describe "Some test", :js => true do
# end
config.around(:each, :js => true) do |example|
# Adapted for Rspec2. This won't work in RSpec 1.
# Put this code in acceptance_helper.rb or better in a new file spec/acceptance/support/javascript.rb
Rspec.configure do |config|
config.before(:each) do
Capybara.current_driver = :selenium if example.metadata[:js]
end
config.after(:each) do
@kkganesan
kkganesan / README.md
Created December 17, 2011 16:26 — forked from dsokolowski/README.md
Integration capybara with minitest

##Integration capybara with minitest

Requirements:

  • ruby 1.9
  • gem capybara

All you have to do is to require file test_helper.rb at the beginning of your test files.

@kkganesan
kkganesan / demo.feature
Created December 17, 2011 16:00
Navigation to new window using capybara/selenium gives blank page
Feature: Demo
Yahoo authentication
@user_login
Scenario: logging in as user
Given I am in "http://mail.yahoo.com"
Then I should see "Sign in to Yahoo!"
And I fill in userid with "YOUR_USERID" and password "YOUR_PASSWORD"
And I press "Sign In"
Then I should be logged in and find "INBOX"
package no.muda.jetty;
import org.constretto.ConstrettoBuilder;
import org.constretto.ConstrettoConfiguration;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.handler.HandlerList;
import org.eclipse.jetty.webapp.WebAppContext;
import org.springframework.core.io.DefaultResourceLoader;
import java.io.IOException;