Skip to content

Instantly share code, notes, and snippets.

View fxcosta's full-sized avatar
:octocat:
Focusing

Felix Costa fxcosta

:octocat:
Focusing
View GitHub Profile
Ld /Users/sotero/Library/Developer/Xcode/DerivedData/esl-egsmqvltvmiyfocsavspcrbvxrht/Build/Products/Debug-iphonesimulator/RNFBApp/RNFBApp.framework/RNFBApp normal x86_64 (in target 'RNFBApp' from project 'Pods')
cd /Users/sotero/Documents/soterotech/esl-app/ios/Pods
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -target x86_64-apple-ios9.0-simulator -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.1.sdk -L/Users/sotero/Library/Developer/Xcode/DerivedData/esl-egsmqvltvmiyfocsavspcrbvxrht/Build/Products/Debug-iphonesimulator/RNFBApp -F/Users/sotero/Library/Developer/Xcode/DerivedData/esl-egsmqvltvmiyfocsavspcrbvxrht/Build/Products/Debug-iphonesimulator/RNFBApp -F/Users/sotero/Library/Developer/Xcode/DerivedData/esl-egsmqvltvmiyfocsavspcrbvxrht/Build/Products/Debug-iphonesimulator/DoubleConversion -F/Users/sotero/Library/Developer/Xcode/DerivedData/esl-egsmqvltvmiyfocsavspcrbvxrh
@fxcosta
fxcosta / sqlserverstintersects.sql
Created February 26, 2020 00:02
SQL Server Spatial data Intersects function: check if a specific lat and long is within a coordinate bounds (like from google maps)
DECLARE @boundingRect varchar(1000)
DECLARE @maxLat VARCHAR(20)
DECLARE @minLong VARCHAR(20)
DECLARE @minLat VARCHAR(20)
DECLARE @maxLong VARCHAR(20)
set @maxLat ='-14.862246900491535'
set @minLong ='-40.843608842004876'
set @minLat ='-14.861471748622773'
@fxcosta
fxcosta / sqlserverstcontains.sql
Created February 18, 2020 20:54
SQL Server query to check if a polygon contains a specific point (coordinates)
DECLARE @g geometry;
DECLARE @h geometry;
SET @g = geometry::STGeomFromText('POLYGON ((-4583852.3559951019 -1744384.5747652152, -4511274.7500624815 -1744384.5747652152, -4511274.7500624815 -1637044.6921474137, -4583852.3559951019 -1637044.6921474137, -4583852.3559951019 -1744384.5747652152))', 4326);
SET @h = geometry::STGeomFromText('POINT (-4546586.20608064 -1672720.54193957)', 4326);
SELECT @g.STContains(@h);
<?php
$test = [
[
'role_id' => 1,
'name' => 'criar conteúdo'
],
[
'role_id' => 1,
'name' => 'criar enquete'
@fxcosta
fxcosta / RotateHandler.cs
Created September 28, 2018 12:54
Testing script for rotate a 3d object in Unity3D
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GestureHandler : MonoBehaviour {
public float rotationSpeed = 8;
public Camera cam;
@fxcosta
fxcosta / git-upload-st.txt
Created June 6, 2018 16:09
Simples e rápido passo a passo sobre como subir algo para o nosso repositório no gitlab
# Projetos novos
1 - Criar repositório remoto no gitlab: https://gitlab.com/projects/new. Seleciona o usuário da soterotech, escolhe nome do projeto
descrição e clica em criar projeto.
2 - Após criar o repositório remoto, o gitlab dâ um guia para começar o projeto git localmente na máquina. Pode seguir exatamente
o que é proposto por ele.
3 - Se seguir o guia do gitlab, você já terá feito o primeiro commit e já terá feito um primeiro push, então está tudo ok.
# Projetos já no gitlab
1 - Clonar o projeto usando o comando `git clone URL_DO_PROJETO_NO_GITLAB` não esquecendo de usar o endereço HTTPS ao invés do SSH.
2 - O projeto estará na sua máquina bastando commitar e enviar os pushs
canvasName = "mycanvas";
document.getElementById(canvasName).addEventListener('mousemove', function(evt) {
var xy = getMousePos(evt);
var position = (xy.x) + ', ' + (xy.y);
alert(position);
}
@fxcosta
fxcosta / Laravel-Container.md
Created February 1, 2018 16:33
Laravel's Dependency Injection Container in Depth

Laravel's Dependency Injection Container in Depth

Laravel has a powerful Inversion of Control (IoC) / Dependency Injection (DI) Container. Unfortunately the official documentation doesn't cover all of the available functionality, so I decided to experiment with it and document it for myself. The following is based on Laravel 5.4.26 - other versions may vary.

Introduction to Dependency Injection

I won't attempt to explain the principles behind DI / IoC here - if you're not familiar with them you might want to read What is Dependency Injection? by Fabien Potencier (creator of the Symfony framework).

Accessing the Container

@fxcosta
fxcosta / convertStringToAssociativeArray.php
Created December 6, 2017 22:44
Convert string in "level1.level2.leveln" in assoaciative array to get value
function printMultiArray($originalArray, $string)
{
$temp = $originalArray;
$nameArray = explode('.', $string);
foreach($nameArray as $string) {
$temp = $temp[$name];
}
return $temp;
@fxcosta
fxcosta / loopingAndChartjs.php
Created November 6, 2017 01:45
Simples script pra ajudar a dúvida de uma pessoa no Laravel Brasil sobre usar o fxcosta/laravel-chartjs de maneira dinâmica: https://www.facebook.com/groups/laravelbrasil/permalink/1604536466235069/
<?php
$dados = $objetoQualquer->meDeTodosOsDados(); // seu select seja da forma como você faz.
$arrayCompleto = []; // esse será nosso array principal que agrupará os outros arrays.
foreach($dados as $dado) {
$arrayCompleto[] = [
'label' => $dado->label,
'backgroundColor' => $dado->color