Skip to content

Instantly share code, notes, and snippets.

View plcosta's full-sized avatar

Pedro Costa plcosta

  • Brazil
  • 14:50 (UTC -03:00)
View GitHub Profile
@plcosta
plcosta / git.md
Created February 9, 2018 18:38 — forked from twoism-dev/git.md
Hybrid Git Flow

Our Git Flow

We are using a simple git flow based on git flow and github flow. We have two branches develop and master.

develop is a representation of staging

master is a representation of production

The Rules

@plcosta
plcosta / query.sql
Last active September 14, 2017 15:34
Move Discourse Topics from one category to another
-- cd /var/discourse
-- ./launcher enter app
-- su discourse
-- psql
-- MOVE TOPICS CATEGORY
-- CURRENT CATEGORY: 1
-- NEW CATEGORY: 2
UPDATE topics SET category_id = 2 WHERE category_id = 1;
@plcosta
plcosta / dynamic-facebook-comments.js
Created July 31, 2017 15:41 — forked from mjangda/dynamic-facebook-comments.js
Dynamically load Facebook comments on your site (if you already have the FB API running)
jQuery( function( $ ) {
if ( 'undefined' === typeof FB )
return;
if ( $( 'body' ).hasClass( 'single-post' ) || $( 'body' ).hasClass( 'page' ) ) {
var $comments_div = $( '<div/>' );
$comments_div.addClass( 'fb-comments' );
$comments_div.attr( 'data-href', document.location );
$comments_div.appendTo( $( '.primary-content' ) );
@plcosta
plcosta / nginx.conf
Last active July 11, 2017 14:24
nginx conf for uploads directory - development/staging environment - get uploads from production
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
...
...
...
# Matches any URL containing /wp-content/uploads/ or /app/uploads/ (using bedrock)
location ~ "^(.*)/app/uploads/(.*)$" {
try_files $uri @prod_serv;
@plcosta
plcosta / dnsmasq OS X.md
Created September 27, 2016 13:39 — forked from ogrrd/dnsmasq OS X.md
Setup dnsmasq on OS X

Never touch your local /etc/hosts file in OS X again

To setup your computer to work with *.dev domains, e.g. project.dev, awesome.dev and so on, without having to add to your hosts file each time.

Requirements

Install

<div class="col-md-4" v-for="(index, group) in wards" track-by="$index">
<div class="ibox">
<div class="ibox-title"><strong>{{ index }}</strong></div>
<div class="ibox-content">
<div class="col-md-2 bed" v-for="patient in group">
<a v-link="" v-if="patient.id" class="bed-default">{{ patient.bed_id }}</a>
</div>
</div>
</div>
</div>
@plcosta
plcosta / Bed.php
Created March 3, 2016 08:39
Lumen bug?
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Bed extends Model
{
}
// api/index.js
import Request from 'superagent'
export const getUser (userId) {
return Request
.get('/api/user/:userId');
}
@plcosta
plcosta / view.php
Created February 2, 2016 11:05
Using Laravel groupBy
@section('content')
<div class="row">
@foreach($beds->groupBy('ward_id') as $key => $grouped)
<div class="col-sm-4"> <!-- ENFERMARIA -->
<div class="panel panel-default border-top-success border-bottom-success">
<div class="panel-heading"><h5 class="panel-title">{{ $key }}</h5></div>
<div class="panel-body">
@foreach($grouped as $bed)
<div class="col-sm-3">
<div style="text-align: center;">
@plcosta
plcosta / Vagrantfile
Created January 5, 2016 18:17
My Vagrant File
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# hospub - debian 7
config.vm.define "hospub" do |hospub|