Skip to content

Instantly share code, notes, and snippets.

@marcuspmd
marcuspmd / robot.js
Created December 7, 2012 13:58
MarcusP
var Robot = function(robot){
robot.turnLeft(robot.angle % 90);
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
if (robot.parentId) {
robot.ahead(1);
robot.turnGunRight(1);
}
else {
@marcuspmd
marcuspmd / git-update-fork.sh
Created July 24, 2017 23:17 — forked from rdeavila/git-update-fork.sh
Git: como atualizar um fork com as mudanças do original?
#!/bin/bash
# Adicione um novo remote; pode chamá-lo de "upstream":
git remote add upstream https://github.com/usuario/projeto.git
# Obtenha todos os branches deste novo remote,
# como o upstream/master por exemplo:
git fetch upstream
@marcuspmd
marcuspmd / doc.api
Created January 19, 2021 16:23
doc.api
/**
* @api {GET} /cep/{cep} 1 - Consultar Cep
* @apiHeader {String} Token Autenticação via token.
* @apiName Consulta
* @apiVersion 1.0.0
* @apiGroup Cep
*
*
* @apiParam (Consulta) {String{11}} cep Cep para buscar o endereço, sem nenhuma formatação.
* @apiSampleRequest https://link/api/cep/
sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install php7.4
sudo apt install php7.4-common php7.4-fpm php7.4-mysql php7.4-xml php7.4-xmlrpc php7.4-curl php7.4-gd php7.4-imagick php7.4-cli php7.4-dev php7.4-imap php7.4-mbstring php7.4-opcache php7.4-soap php7.4-zip php7.4-intl php7.4-xdebug -y
/etc/php/7.4/apache2/php.ini
@marcuspmd
marcuspmd / php-docker-ext
Created July 25, 2022 01:40 — forked from hoandang/php-docker-ext
Complete list of php docker ext
RUN apt update
RUN apt upgrade -y
RUN apt install -y apt-utils
RUN a2enmod rewrite
RUN apt install -y libmcrypt-dev
RUN docker-php-ext-install mcrypt
RUN apt install -y libicu-dev
RUN docker-php-ext-install -j$(nproc) intl
RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng12-dev
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
@marcuspmd
marcuspmd / table_user.csv
Created September 21, 2022 15:51
Table User Medium
id name
1 Marcus
2 Carlos
3 João
4 Maria
SELECT
u.id,
u.name,
a.type,
a.street
FROM
users as u
JOIN address as a on a.user_id = u.id
SELECT
u.id,
u.name,
(select a.type from address as a where a.user_id = u.id limit 1 order by id asc) as type,
(select a.street from address as a where a.user_id = u.id limit 1 order by id asc) as street
FROM
users as u
SELECT
u.id,
u.name,
a.type,
a.street
FROM
users as u,
Lateral (
SELECT
address.type,
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
// This widget is the root of your application.