Skip to content

Instantly share code, notes, and snippets.

View nerdic-coder's full-sized avatar
💭
Block Photos 2.0 will be out soon and is going to be great!

Johan Axelsson nerdic-coder

💭
Block Photos 2.0 will be out soon and is going to be great!
View GitHub Profile
Verifying my Blockstack ID is secured with the address 1C9BfWgWvJLM7duXJBojwzjqj1xDyzdB8E https://explorer.blockstack.org/address/1C9BfWgWvJLM7duXJBojwzjqj1xDyzdB8E
@nerdic-coder
nerdic-coder / file.txt
Created April 7, 2018 20:21
Verifying my Blockstack ID is secured with the address 1CL2HLfy1YEFQN6i5DsTBSWMYS5FKbthYk https://explorer.blockstack.org/address/1CL2HLfy1YEFQN6i5DsTBSWMYS5FKbthYk
Verifying my Blockstack ID is secured with the address 1CL2HLfy1YEFQN6i5DsTBSWMYS5FKbthYk https://explorer.blockstack.org/address/1CL2HLfy1YEFQN6i5DsTBSWMYS5FKbthYk
@nerdic-coder
nerdic-coder / jestGlobalMocks.ts
Created April 17, 2018 21:41
Example of jestGlobalMocks.ts
const mock = () => {
let storage = {};
return {
getItem: key => key in storage ? storage[key] : null,
setItem: (key, value) => storage[key] = value || '',
removeItem: key => delete storage[key],
clear: () => storage = {},
};
};
@nerdic-coder
nerdic-coder / heroes.tsx
Created April 19, 2018 21:48
heroes.tsx (initial version)
import { Component } from '@stencil/core';
@Component({
tag: 'app-heroes',
styleUrl: 'heroes.css'
})
export class Heroes {
render() {
@nerdic-coder
nerdic-coder / heroes.spec.ts
Created April 19, 2018 21:50
heroes.spec.ts (initial version)
import { render } from '@stencil/core/testing';
import { Heroes } from './heroes';
describe('app-heroes', () => {
it('should build', () => {
expect(new Heroes()).toBeTruthy();
});
describe('rendering', () => {
beforeEach(async () => {
@nerdic-coder
nerdic-coder / app-home.tsx
Created April 20, 2018 19:13
app-heroes in app-home.tsx
<div class='app-home'>
<app-heroes></app-heroes>
<stencil-route-link url='/profile/stencil'>
<button>
Profile page
</button>
</stencil-route-link>
</div>
@nerdic-coder
nerdic-coder / hero.ts
Created April 20, 2018 20:44
Hero class
export class Hero {
id: number;
name: string;
}
@nerdic-coder
nerdic-coder / heroes.tsx
Created April 20, 2018 20:51
heroes.tsx with hero object
import { Component } from '@stencil/core';
import { Hero } from '../../models/hero';
@Component({
tag: 'app-heroes',
styleUrl: 'heroes.css'
})
export class Heroes {
private hero:Hero = {
@nerdic-coder
nerdic-coder / heroes.tsx
Created April 20, 2018 22:25
heroes.tsx two-way binding
import { Component, State } from '@stencil/core';
import { Hero } from '../../models/hero';
@Component({
tag: 'app-heroes',
styleUrl: 'heroes.css'
})
export class Heroes {
@State() private hero:Hero = {
@nerdic-coder
nerdic-coder / mock-heroes.ts
Created April 24, 2018 18:17
mock-heroes.ts
import { Hero } from '../../models/hero';
export const HEROES: Hero[] = [
{ id: 11, name: 'Mr. Nice' },
{ id: 12, name: 'Narco' },
{ id: 13, name: 'Bombasto' },
{ id: 14, name: 'Celeritas' },
{ id: 15, name: 'Magneta' },
{ id: 16, name: 'RubberMan' },
{ id: 17, name: 'Dynama' },