Skip to content

Instantly share code, notes, and snippets.

View romuloctba's full-sized avatar
:octocat:

RcDev romuloctba

:octocat:
View GitHub Profile
@romuloctba
romuloctba / introrx.md
Created June 15, 2018 14:40 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@romuloctba
romuloctba / wordpress-development-quick-and-ease-using-docker-and-kitematic.md
Last active September 23, 2020 13:16
WordPress development quick and ease, using Docker and Kitematic

Creating the quick Dev env

This method creates quickly new WP Instances and is great for testing, developping, and trying things without messing 'real' installations.

This aproach uses Docker as container system, and we will run 1 container with WP and another for the DB.

  1. Install docker. Since I had many problems using Docker for Windows (dont judge), I used Docker Toolbelt utility: https://docs.docker.com/toolbox/overview/#ready-to-get-started
@romuloctba
romuloctba / wordpress-custom-import-tutorial-demo.php
Last active January 20, 2023 22:32 — forked from royduin/import-demo.php
Example Wordpress custom import (post type, meta, image from url, etc) see: https://royduineveld.nl/creating-your-own-wordpress-import/
<?php
/*
Plugin Name: Import demo
Plugin URI: http://royduineveld.nl
Description: A demo import for my blog
Version: 1.0
Author: Roy Duineveld
Author URI: http://royduineveld.nl
*/
@romuloctba
romuloctba / fb-page-feed.js
Created November 11, 2017 11:46 — forked from julienrf/fb-page-feed.js
A small js snippet retrieving the feed of a Facebook page and displaying its elements.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript"></script>
<script src="http://connect.facebook.net/fr_FR/all.js"></script>
<script>
// Replace the id by any other public page id
FB.api('170913076256527/feed', { limit: 3 }, function(result) {
$('#fb-feed').empty();
$(result.data).each(function(i, post) {
entry = $('<div class="fb-item"></div>');
if (post.icon) {
entry.append('<img class="icon" src="' + post.icon + '" />');
@romuloctba
romuloctba / change-wp-url.sql
Created November 5, 2017 11:26
Change WP site URL on the DB
UPDATE wp_options SET option_value = replace(option_value, 'http://192.168.99.100:32771', 'http://newUrl.com.br/v2/') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://192.168.99.100:32771','http://newUrl.com.br/v2/');
UPDATE wp_posts SET post_content = replace(post_content, 'http://192.168.99.100:32771', 'http://newUrl.com.br/v2/');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://192.168.99.100:32771','http://newUrl.com.br/v2/');
UPDATE wp_options SET option_value = replace(option_value, 'http://www.192.168.99.100:32771', 'http://newUrl.com.br/v2/') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://www.192.168.99.100:32771','http://newUrl.com.br/v2/');
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.192.168.99.100:32771', 'http://newUrl.com.br/v2/');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.192.168.99.100:32771','http://newUrl.com.br/v2/');
@romuloctba
romuloctba / functions.php
Created October 14, 2017 20:50
Estados e cidades brasileiras populados em uma taxonomia do wordpress.
<?php
// É aconselhável criar um backup do banco antes
// crie a taxonomia cidade na functions do tema
add_action('init', 'register_locations');
function register_locations() {
register_taxonomy( 'cidade',array (
0 => 'locais',
),
array( 'hierarchical' => true,
@romuloctba
romuloctba / textSearch.mongo.query.js
Created December 17, 2016 12:49
Text Search in Mongo DB / Busca de Texto no Mongodb
// You can only search text if you have text-search indexes. Easy Peasy.
// Você só pode buscar por texto se tiver um index (índice) de texto. Fácil pacas.
// ---
// To create a text index, run:
// Para criar um index, rode:
// (english example) db.collectionName.createIndex({ fieldName: "text" });
// (portuguese example) db.nomeDaCollection.createIndex({ nomeDoCampo: "text" });
// Ex: Collection "cars", fields "name", "model"
db.cars.createIndex({ name: "text", model: "text", brand: "text" });
@romuloctba
romuloctba / app.js
Created September 1, 2016 16:03
Using Canvas with NodeJS to create a composite of images
var fs = require('fs');
var path = require('path');
var Canvas = require('canvas');
var Image = Canvas.Image;
var img = new Image();
var mask = new Image();
img.onload = function () {
var w = img.width;
@romuloctba
romuloctba / gist:a0bae1fb8e152b4dfb9718859e1a9c67
Created August 26, 2016 21:06
Error Imagemagick Native status 127

Problem:

bin/sh: Magick++-config: command not found
gyp: Call to 'Magick++-config --ldflags --libs' returned exit status 127 while in binding.gyp. while trying to load binding.gyp

Solution: yum install ImageMagick-c++ ImageMagick-c++-devel

http://www.codingsection.com/create-your-own-offline-video-playback-system-like-youtube.html