Skip to content

Instantly share code, notes, and snippets.

View plcosta's full-sized avatar

Pedro Costa plcosta

  • Brazil
  • 10:45 (UTC -03:00)
View GitHub Profile
// api/index.js
import Request from 'superagent'
export const getUser (userId) {
return Request
.get('/api/user/:userId');
}
@crot4lus
crot4lus / facebook-to-disqus.php
Created September 11, 2014 09:21
Import Facebook comments to Disqus
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dsq="http://www.disqus.com/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:wp="http://wordpress.org/export/1.0/"
>
<channel>
<?php
error_reporting(0);
  1. Go to Deployment Hooks -> Clone new release -> After this action -> Add Hook and add this line:
ln -s {{project}}/storage/wp-config.php {{release}}/wp-config.php
  1. Add this configuration under Linked Folders:
wp-content/uploads -> storage/wp-content/uploads	
@iloveitaly
iloveitaly / graffle2hash.rb
Created December 16, 2011 18:34
Convert Hierarchical OmniGraffle Document to JSON
#!/usr/bin/env ruby
# rubycocoa
require 'osx/cocoa'
include OSX
OSX.require_framework 'ScriptingBridge'
class GraffleConverter
def initialize
@graffle = SBApplication.applicationWithBundleIdentifier_("com.omnigroup.OmniGraffle")
@bondario
bondario / ubuntu1204_php54
Created August 9, 2013 15:54
Downgrade php 5.5 to 5.4 or keep php 5.4 for Ubuntu 12.04.02 LTS
apt-get install -y ppa-purge
add-apt-repository -y ppa:ondrej/php5-oldstable
apt-get update
ppa-purge ppa:ondrej/php5
apt-get update && apt-get upgrade -y && apt-get autoremove -y && apt-get autoclean -y
@henrik
henrik / heroku_db_to_dokku_psql_single_container.sh
Last active October 30, 2018 20:48
Copying a Heroku DB to dokku-psql-single-container.
cd my_heroku_app
# Make sure DB doesn't update on Heroku. This may be enough depending on your needs.
heroku maintenance:on
# Dump from Heroku.
heroku pg:pull DATABASE_URL heroku_dump
pg_dump heroku_dump -Fc > /tmp/db.dump # Fc for binary dump (otherwise the import will complain)
# Restore to Dokku.
@puredazzle
puredazzle / webpack.mix.js
Last active December 21, 2018 06:25
Advanced Laravel Mix setup for WordPlate - https://github.com/wordplate/wordplate
const mix = require('laravel-mix');
const resources = 'resources/assets';
const themePath = 'public/themes/wordplate';
const assetsPath = `${themePath}/assets`;
mix.setPublicPath(assetsPath);
mix.setResourceRoot('../');
mix.browserSync({
@twoism-dev
twoism-dev / git.md
Last active March 13, 2019 18:57
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

@dasDaniel
dasDaniel / vue-test-utils-helpers.js
Last active March 26, 2019 17:01
helper functions for vue-test-utils
function withWrapperArray(wrapperArray) {
return {
childSelectorHasText: (selector, str) => wrapperArray.filter(i => i.find(selector).text().match(str)),
hasText: (str) => wrapperArray.filter(i => i.text().match(str)),
areVisible: () => wrapperArray.wrappers.filter(w => w.isVisible()).length,
areHidden: () => wrapperArray.wrappers.filter(w => !w.isVisible()).length,
areAllVisible: () => wrapperArray.wrappers.every(w => w.isVisible()),
areAllHidden: () => wrapperArray.wrappers.every(w => !w.isVisible()),
}
}
@iloveitaly
iloveitaly / mysql2graffle.py
Created December 16, 2011 16:36
Visual Representation of MySQL Table in OmniGraffle
#! /usr/bin/pythonw
#
# Modified by Michael Bianco <info@cliffsidedev.com> on June 26, 2009
# Written by Thomas Pan at January 21, 2007
# mysql2graffle for Omnigraffle 5 is based on
# MyDBGraffle for OmniGraffle 4 which is based on Paul Davis' work at http://www.visualdistortion.org
#
# Requires:
#
# OmniGraffle 5