Skip to content

Instantly share code, notes, and snippets.


Pedro Costa plcosta

View GitHub Profile
View api_index.js
// api/index.js
import Request from 'superagent'
export const getUser (userId) {
return Request
crot4lus / facebook-to-disqus.php
Created Sep 11, 2014
Import Facebook comments to Disqus
View facebook-to-disqus.php
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
ozgun / boolean_store_accessor.rb
Last active Jun 1, 2017
Using ActiveRecord::Store to store boolean fields
View boolean_store_accessor.rb
# File: app/models/concerns/boolean_store_accessor.rb
# When we submit a form in order to update a model, a booelan/checkbox field is posted
# as '1' or '0', and if we are using ActiveRecord::Store, posted value is stored in
# database as '1' or '0'. By the help of this module, we store '1' and '0'
# values as `true` or `false`.
# Example usage:
# ```
  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 / graffle2hash.rb
Created Dec 16, 2011
Convert Hierarchical OmniGraffle Document to JSON
View graffle2hash.rb
#!/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 / ubuntu1204_php54
Created Aug 9, 2013
Downgrade php 5.5 to 5.4 or keep php 5.4 for Ubuntu 12.04.02 LTS
View ubuntu1204_php54
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 /
Last active Oct 30, 2018
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 / webpack.mix.js
Last active Dec 21, 2018
Advanced Laravel Mix setup for WordPlate -
View webpack.mix.js
const mix = require('laravel-mix');
const resources = 'resources/assets';
const themePath = 'public/themes/wordplate';
const assetsPath = `${themePath}/assets`;
twoism-dev /
Last active Mar 13, 2019
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 / vue-test-utils-helpers.js
Last active Mar 26, 2019
helper functions for vue-test-utils
View vue-test-utils-helpers.js
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()),
You can’t perform that action at this time.