Skip to content

Instantly share code, notes, and snippets.

View fmoliveira's full-sized avatar

Filipe Oliveira fmoliveira

  • Level Access
  • Toronto
  • 08:25 (UTC -04:00)
View GitHub Profile
@fmoliveira
fmoliveira / logstash-sentry.rb
Created April 21, 2017 16:40 — forked from clarkdave/logstash-sentry.rb
(Logstash) Sentry output plugin
# The MIT License (MIT)
# Copyright (c) 2014 Dave Clark
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:

Folder Structure

Motivations

  • Clear feature ownership
  • Module usage predictibility (refactoring, maintainence, you know what's shared, what's not, prevents accidental regressions, avoids huge directories of not-actually-reusable modules, etc)
@fmoliveira
fmoliveira / react_fiber.md
Created February 4, 2017 17:38 — forked from geoffreydhuyvetters/react_fiber.md
What is React Fiber? And how can I try it out today?
@fmoliveira
fmoliveira / Event-stream based GraphQL subscriptions.md
Created February 3, 2017 00:30 — forked from OlegIlyenko/Event-stream based GraphQL subscriptions.md
Event-stream based GraphQL subscriptions for real-time updates

In this gist I would like to describe an idea for GraphQL subscriptions. It was inspired by conversations about subscriptions in the GraphQL slack channel and different GH issues, like #89 and #411.

Conceptual Model

At the moment GraphQL allows 2 types of queries:

  • query
  • mutation

Reference implementation also adds the third type: subscription. It does not have any semantics yet, so here I would like to propose one possible semantics interpretation and the reasoning behind it.

export const GoogleApi = function(opts) {
opts = opts || {}
const apiKey = opts.apiKey;
const libraries = opts.libraries || [];
const client = opts.client;
const URL = 'https://maps.googleapis.com/maps/api/js';
const googleVersion = '3.22';
let script = null;
@fmoliveira
fmoliveira / Codemod RN24 to RN25.md
Created November 9, 2016 13:09 — forked from sibelius/Codemod RN24 to RN25.md
Codemod React Native 24 imports to RN25 imports

README

Why this transform is necessary?

Until React Native 24, you import React from 'react-native' package, but this will change on RN 25, you will need to import React from 'react'. You probably have many files that does this, so I've created a codemod to save you a bunch of time

How to use this

  • Install jscodeshif
@fmoliveira
fmoliveira / after.sh
Created October 4, 2016 21:43 — forked from justincampbell/after.sh
Jenkins + GitHub Commit Status API
if [[ $BUILD_STATUS == "success" ]]
then
export STATUS="success"
else
export STATUS="failure"
fi
curl "https://api.github.com/repos/justincampbell/my_repo/statuses/$GIT_COMMIT?access_token=abc123" \
-H "Content-Type: application/json" \
-X POST \
@fmoliveira
fmoliveira / Deploy-Windows-Service-Via-MSBuild.proj.xml
Created September 15, 2016 14:25 — forked from mrchief/Deploy-Windows-Service-Via-MSBuild.proj.xml
MSBuild Script to deploy Windows Service to remote or local machine
<Project DefaultTargets="CopyOutputs;DeployService" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<!-- These settings control what the service's name, description etc appear in services.msc task panel. -->
<PropertyGroup Label="ServiceMetaData">
<ServiceName>ShinyNewService</ServiceName>
<ServiceDisplayName>Shiny New Service</ServiceDisplayName>
<ServiceDescription>A shiny new service, that changes the world for the greater good.</ServiceDescription>
</PropertyGroup>
<Choose>
@fmoliveira
fmoliveira / storeImgInMongoWithMongoose.js
Created August 24, 2016 23:31 — forked from aheckmann/storeImgInMongoWithMongoose.js
store/display an image in mongodb using mongoose/express
/**
* Module dependencies
*/
var express = require('express');
var fs = require('fs');
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
// img path
@fmoliveira
fmoliveira / deprecated.ts
Created August 18, 2016 12:49 — forked from michelsalib/deprecated.ts
Typescript @deprecated annotation
class Dog {
@deprecated('Dogs don\'t roar, they talk.')
roar() {
console.log('RRRRR');
}
@deprecated()
smile() {
console.log('smile');
}