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
View gist:3769e64fafa0d1f7a6e848e827716f79
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
View file.txt
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
View 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)
View heroes.tsx
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)
View heroes.spec.ts
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
View 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
View hero.ts
export class Hero {
id: number;
name: string;
}
@nerdic-coder
nerdic-coder / heroes.tsx
Created April 20, 2018 20:51
heroes.tsx with hero object
View heroes.tsx
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
View heroes.tsx
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
View 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' },