Skip to content

Instantly share code, notes, and snippets.

var testRetryCounter = 0;
var assert = chai.assert;
$.ajax = function(opts) {
testRetryCounter++;
setTimeout(opts.error, 0);
};
describe('Data', function() {
describe('#sendData()', function() {
@ynonp
ynonp / karma.conf.js
Created October 9, 2013 18:53
Karma config file that can serve static HTML fixtures
// Karma configuration
// Generated on Sun Sep 22 2013 11:31:34 GMT+0300 (IDT)
module.exports = function(config) {
config.set({
// base path, that will be used to resolve files and exclude
basePath: '',
preprocessors: {
var assert = chai.assert;
describe('Sinon', function() {
describe('spies', function() {
it('should keep count', function() {
// fill code here
spy();
spy();
spy();
@ynonp
ynonp / fixtures.js
Created October 23, 2013 08:57
A small library for handling fixtures in Mocha unit tests
function Fixtures(opts) {
var self = this;
opts = opts || {};
self.base = opts.base ? opts.base : "";
self._cache = {};
self.fixture_id = opts.fixture_id || "fixture";
self.el;
return {
@ynonp
ynonp / index.html
Created November 2, 2013 06:42
Angular lab1
<!DOCTYPE html>
<html ng-app="MyApp">
<head>
<title>CoolShop</title>
<style>
.item label {
margin: 10px;
display: inline-block;
min-width: 250px;
}
@ynonp
ynonp / about.html
Last active December 28, 2015 16:29
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap.min.css" />
<style>
body { padding-top: 80px; }
</style>
</head>
<body>
<!DOCTYPE html>
<html ng-app="Intro">
<head>
<title>Hello Angular</title>
<style>
body {
font-size: 2em;
}
@ynonp
ynonp / main.cpp
Created December 27, 2013 15:14
QProcess output example
#include <QCoreApplication>
#include <QtCore/QtCore>
#include "monitor.h"
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QProcess p;
p.start("/bin/ls");
@ynonp
ynonp / lab01.md
Last active November 15, 2022 09:43

Part 1: Welcome to Unix

  1. Login to your Unix account
  2. Find your current shell, the default shell and a list of all installed shells.
  3. List all files and directories in /etc folder ordered by size (hint: man ls).
  4. Print the current date and time formatted as follows:
    Sun 21/03/2010, 14:30 (hint: man date)

Unix Commands Summary

Unix Scripting Lab - Solutions

Part 1: Welcome to Unix

  1. Login to your Unix account
  2. Find your current shell, the default shell and a list of all installed shells.
  • current shell: echo $0
  • default shell: echo $SHELL
  • all shells: cat /etc/shells