Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Pedro Costa plcosta

🎯
Focusing
View GitHub Profile
@plcosta
plcosta / git.md
Created Feb 9, 2018 — forked from twoism-dev/git.md
Hybrid Git Flow
View git.md

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 Sep 14, 2017
Move Discourse Topics from one category to another
View query.sql
-- 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 Jul 31, 2017 — forked from mjangda/dynamic-facebook-comments.js
Dynamically load Facebook comments on your site (if you already have the FB API running)
View dynamic-facebook-comments.js
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 Jul 11, 2017
nginx conf for uploads directory - development/staging environment - get uploads from production
View nginx.conf
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 Sep 27, 2016 — forked from ogrrd/dnsmasq OS X.md
Setup dnsmasq on OS X
View dnsmasq OS X.md

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

View gist:1f1281b04bfbb0008a28630003b232c1
<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>
View Bed.php
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Bed extends Model
{
}
View api_index.js
// api/index.js
import Request from 'superagent'
export const getUser (userId) {
return Request
.get('/api/user/:userId');
}
@plcosta
plcosta / view.php
Created Feb 2, 2016
Using Laravel groupBy
View view.php
@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;">
View Vagrantfile
# -*- 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|