Skip to content

Instantly share code, notes, and snippets.

@atafs
atafs / docker.md
Created October 14, 2020 00:31
Docker cheatsheet with commands useful in daily work!!

run my first docker image and container

docker run hello-world

@atafs
atafs / FlatListCard.js
Last active November 19, 2018 12:21
Generic Component: Card with styles for a FlatList
import React from 'react'
import { StyleSheet, View } from 'react-native'
const FlatListCard = props => {
const { children, name } = props
switch (name) {
default: {
return <View style={styles.layout}>{children}</View>
}
@atafs
atafs / main.dart
Last active October 1, 2018 09:46
DartLang: Classes
main() {
var hugo = new Hugo();
hugo.name = 'Ben10';
hugo.lastName = 'Smith';
hugo.nationality = 'Portuguese';
hugo.greeting = 'Hello!!';
hugo.profession = 'Trainer!!';
hugo.printGreeting();
hugo.printPerson();
@atafs
atafs / main.dart
Last active September 8, 2018 13:04
DartLang: Functions
void main() {
showName();
sayMyName();
sayHello(9);
for(var index = 0; index < 50; index++) {
sayHello(index);
}
}
@atafs
atafs / pushNotifications.spec.js
Last active August 15, 2018 17:07
Push Notifications e2e tests using Detox from Wix
/* eslint-disable no-undef */
const { randomNumber } = require('../Helpers/index.js')
const mockNotification = {
"trigger": {
"type": "push"
},
"title": "From push",
"subtitle": "Subtitle",
"body": "Body",
@atafs
atafs / main.dart
Created July 22, 2018 14:23 — forked from filipejbmira/main.dart
Dartlang: Loops
void main() {
var football = ['Ronaldo', 'Messi', 'Filipe', 'Nmeymar JR'];
for(var i = 0; i < 4; i++) {
print('$i ${football[i]}');
}
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
@atafs
atafs / main.dart
Created June 10, 2018 23:18
DartLang: Variables (hello world)
void main() {
const helloWorld = 'Hello World of Programming in Dart';
print('helloWorld: ${helloWorld}');
}
@atafs
atafs / main.dart
Created June 10, 2018 11:17
Dartlang: Conditions
void main() {
const name = 'Americo';
print('Name: ${name}');
if (name == 'Americo') {
print('Printing the IF: I LOVE technology');
} else {
print('Printing the Else: FOOTBALL!! #young magicians generation');
}
}
@atafs
atafs / saga-effect-cancel-canceled.js
Last active June 5, 2018 22:03
Saga Effect Cancel/Canceled
// 1
let process = function*() {
try {
while(true) {
console.log('Process looped')
yield delay(500)
}
} finally {
const cancelled = yield effects.cancelled()
console.info('Cancelled?', cancelled)