Skip to content

Instantly share code, notes, and snippets.

View samwx's full-sized avatar
💻
Coding

Samuel Martins samwx

💻
Coding
View GitHub Profile
[
{
"identifier": {
"id": "ms-vscode.vscode-typescript-tslint-plugin",
"uuid": "90a37ca1-92a2-488a-b196-7a8c0b0127ea"
},
"version": "1.3.4",
"location": {
"$mid": 1,
"path": "/Users/samuel/.vscode/extensions/ms-vscode.vscode-typescript-tslint-plugin-1.3.4",
@samwx
samwx / .vimrc
Created September 24, 2022 14:11
call plug#begin('~/.vim/plugged')
Plug 'mattn/emmet-vim'
Plug 'prettier/vim-prettier'
Plug 'sheerun/vim-polyglot'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'dense-analysis/ale'
Plug 'preservim/nerdtree'
" Themes
function App(props) {
return (
<div className="App">
<h1>{props.title}</h1>
<h2>Start editing to see some magic happen!</h2>
</div>
);
}
@samwx
samwx / .zshrc
Created October 22, 2019 16:13
Create a folder and enter it
function mkd() {
mkdir -p "$@" && cd "$_";
}
{"v":"5.5.9","fr":25,"ip":0,"op":45,"w":300,"h":265,"nm":"Convidar-membros","ddd":0,"assets":[{"id":"comp_0","layers":[{"ddd":0,"ind":1,"ty":4,"nm":"tampa carta/letter-animation contornos","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":6,"s":[0]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":8,"s":[90]},{"t":11,"s":[100]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[306.993,105.5,0],"ix":2},"a":{"a":0,"k":[101.75,86.75,0],"ix":1},"s":{"a":0,"k":[-102.023,-107.067,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[6.215,-5.515],[0,0],[-4.602,0],[0,0],[-3.093,2.92],[0,0]],"o":[[0,0],[3.092,2.92],[0,0],[4.602,0],[0,0],[-6.211,-5.515]],"v":[[-11.25,-38.938],[-100.833,39.713],[-88.982,44.453],[88.981,44.453],[100.833,39.713],[11.249,-38.938]],"c":true},"ix":2},"nm":"Caminho 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.956862804936,0.831372608858,0.490196108351,1],"i
@samwx
samwx / Products.js
Last active September 3, 2019 03:00
Products API
import products from "./products-data.json";
export class Products {
static getProducts() {
return new Promise((resolve, reject) => {
if (products) {
resolve(products);
} else {
reject();
}
@samwx
samwx / Component.js
Created August 3, 2019 04:40
application-choices-criterias
Vue.component('my-component', {
props: ['title', 'body'],
template: '<h1>Hello World</h1>'
})
/**
* <my-component></my-component>
**/
@samwx
samwx / decorator-1.ts
Last active July 6, 2019 19:02
Typescript examples
function SelfDriving(classFn: Function) {
classFn.prototype.selfDrivable = true;
}
@SelfDriving
class SomeCar {
private make: string;
constructor(make: string) {
this.make = make;
}
@samwx
samwx / event-receiver.ts
Last active June 14, 2019 04:17
Micro frontend presentation
init(): void {
this.handleOnReceiveMessage = this.onReceiveMessage.bind(this)
window.addEventListener('message', this.handleOnReceiveMessage)
}
onReceiveMessage(message: MessageEvent) {
const action = message.data
switch(action) {
case 'a':
@samwx
samwx / ReactChannels.jsx
Created January 15, 2019 01:55
Example using react with channels
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
import Channel from '@nodeguy/channel'
const ch = Channel()
export class Generators {
static async waitAndRetrieve() {
const r = await ch.shift()