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
let triple = function (x) {
return x * 3;
}
triple(3); // output: 9
let anotherVariable = triple;
anotherVariable(30); // output: 90
@fxcosta
fxcosta / simpleFunction.js
Created April 19, 2017 05:56
simple named javascript function
function triple(x) {
return x * 3;
}
triple(30);
// 90
@fxcosta
fxcosta / introrx.md
Created February 26, 2017 19:36 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@fxcosta
fxcosta / multiple-3rd-party-widgets.js
Created January 7, 2017 03:02 — forked from zenorocha/multiple-3rd-party-widgets.js
Loading multiple 3rd party widgets asynchronously
(function() {
var script,
scripts = document.getElementsByTagName('script')[0];
function load(url) {
script = document.createElement('script');
script.async = true;
script.src = url;
scripts.parentNode.insertBefore(script, scripts);
import {Sql} from "../providers/Sql";
export class ExamplePage {
constructor(private sql: Sql) {
//sql.query(...);
//...
}
}
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Route;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
class RouteServiceProvider extends ServiceProvider
{
/**
@fxcosta
fxcosta / loop_hist.r
Last active May 11, 2016 00:31
Simples script em R que exibe histograma de posições sequenciais de uma determinada massa de dados e uma plotagem usando curva gaussiana e curva de densidade
#!/usr/bin/Rscript
emg <- read.csv("emg_s1.csv", header = FALSE, sep = "|", dec = ",")
View(emg)
attach(emg)
par(mfrow = c(4, 5))
for(data in 1:20) {
position <- paste(c("V", data), collapse = "")
@fxcosta
fxcosta / scrolling.js
Last active May 11, 2016 00:32
A simple scrolling that works
// <![CDATA[
$(document).ready(function() {
function filterPath(string) {
return string
.replace(/^\//,'')
.replace(/(index|default).[a-zA-Z]{3,4}$/,'')
.replace(/\/$/,'');
}
$('a[href*=#]').each(function() {
@fxcosta
fxcosta / tdd.md
Created December 31, 2015 22:10
Duvida postada no PHP Brasil que contou com ótimas respostas sobre TDD e algumas questões para iniciantes nessa metodologia : https://www.facebook.com/groups/nao.tem.biscoito/permalink/10156480234215160/