Skip to content

Instantly share code, notes, and snippets.

@masimplo
masimplo / startVms.ps1
Last active August 29, 2015 14:22
Start multiple azure vms in the same cloud service
Start-AzureVM -ServiceName $serviceName -Name *
@masimplo
masimplo / Default angular.markdown
Created February 9, 2016 19:11
Default angular
@masimplo
masimplo / console.css
Created March 6, 2016 17:46
jsFiddle console monkey patching
.console-line
{
font-family: monospace;
margin: 2px;
}
@masimplo
masimplo / docker-commands.sh
Last active October 23, 2016 17:03
Docker commands
# Remove all images
docker rmi $(docker images -q)
# Remove all untagged images
docker rmi $(docker images | grep "^<none>" | awk '{print $3}')
# Remove all running containers
docker rm -f $(docker ps -a -q)
# Remove all tangling volumes
#
# Font derived from LED Matrix Studio file: fontv.h
#
# The first element in each array variable is the width of the character
# The remaining 8 elements are the decimal value for each row of
# the character to display
#
# EG for the 'A' character
#
# | *** | = 011100(28)
<section id="languages" class="row">
<aside class="col-sm-3">
<h3>Languages</h3>
</aside>
<div class="col-sm-9">
<div class="row">
<div class="col-sm-6">
<div class="language">
<strong>Greek</strong>
</div>
@masimplo
masimplo / component.spec.ts
Last active December 1, 2016 20:33
Mocking a native plugin
import { NativeKeyboardMock } from './../native/services/native-keyboard.service.mock';
import { Events, Platform, AlertController } from 'ionic-angular';
import { MockGenerator } from './../mocks/mock-generator.helper';
import { TabsPageComponent } from './tabs-page';
import { NativeKeyboard } from '../native/services/native-keyboard.service';
import { Observable } from 'rxjs/Observable';
describe('Tabs tests', function () {
let sut: TabsPageComponent = null;
#!/usr/bin/python
import sys
import time
import fontv
import ldp
# the matrix is a representation of the led's that are lit on the 80x8 display
#
matrix=[[0 for i in xrange(80)] for i in xrange(8)]
#
// Actual code
...
public ngOnInit() {
Observable.interval(3000)
.takeUntil(this._componentDestroyed)
.subscribe(() => this._statusStore.refreshStatus());
}
// Test Code
import { fakeAsync, tick, discardPeriodicTasks } from '@angular/core/testing';
@masimplo
masimplo / accordion-tab.component.spec.ts
Last active June 13, 2017 14:07
Accordion component for Ionic
import { AccordionTabComponent } from './accordion-tab.component';
import { AccordionComponent } from './accordion.component';
describe('AccordionTab::Component', function () {
let accordionComponent: AccordionComponent;
let sut: AccordionTabComponent;
beforeEach(function () {
accordionComponent = new AccordionComponent();
sut = new AccordionTabComponent(accordionComponent);
});