Skip to content

Instantly share code, notes, and snippets.

View romuloctba's full-sized avatar
:octocat:

RcDev romuloctba

:octocat:
View GitHub Profile
/**
* Implementação do algorítimo SoundEx em Javascript.
* @author João Batista Neto
*
* SoundEX é um algorítimo fonético para indexação de nomes pelo som segundo
* sua pronúncia. O algorítimo foi desenvolvido por Robert C. Russell e
* Margaret K. Odell e patenteado em 1918 e 1922.
* {@link http://en.wikipedia.org/wiki/Soundex}
*
* @return {String}
// When using angular-translate it's impossible to make two-way data binding translations yet,
// and this sometimes can be a headache. So I've developed this directive to save some time.
// The view goes like this: <TAG data-bind-translate="scopeObjToTranslate.item.text"></TAG>.
app.directive('bindTranslate', [
'$translate',
'$parse',
function($translate, $parse) {
<?php
/**
* Use * for origin
*/
add_action( 'rest_api_init', function() {
remove_filter( 'rest_pre_serve_request', 'rest_send_cors_headers' );
add_filter( 'rest_pre_serve_request', function( $value ) {
header( 'Access-Control-Allow-Origin: *' );
header( 'Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT, DELETE' );
@romuloctba
romuloctba / countriesArray
Last active September 24, 2015 14:23 — forked from DHS/PHP Countries Array
Javascript array of all country names
var countries = ["Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antarctica", "Antigua and Barbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegowina", "Botswana", "Bouvet Island", "Brazil", "British Indian Ocean Territory", "Brunei Darussalam", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Cayman Islands", "Central African Republic", "Chad", "Chile", "China", "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Congo", "Congo, the Democratic Republic of the", "Cook Islands", "Costa Rica", "Cote d'Ivoire", "Croatia (Hrvatska)", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Timor", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Falkland Islands (Malvin
@romuloctba
romuloctba / arduino-temperature.ino
Created October 2, 2015 19:01 — forked from dansku/arduino-temperature.ino
Arduino LM35 Example
/*
An open-source LM35DZ Temperature Sensor for Arduino. This project will be enhanced on a regular basis
(cc) by Daniel Spillere Andrade , http://www.danielandrade.net
http://creativecommons.org/license/cc-gpl
*/
int pin = 0; // analog pin
int tempc = 0,tempf=0; // temperature variables
int samples[8]; // variables to make a better precision
int maxi = -100,mini = 100; // to start max/min temperature
.woocommerce.single-product .product .summary .variations {
width: 100%;
}
.woocommerce.single-product .product .summary .variations td {
display: block;
width: 100%;
}
.woocommerce.single-product .product .summary .variations td label {
font-family: 'Nunito', Helvetica, Arial, sans-serif;
letter-spacing: 0px;
@romuloctba
romuloctba / mongo_bkp.markdown
Created December 2, 2015 13:09 — forked from cristopher-rodrigues/mongo_bkp.markdown
Mongo copy last data (SIMPLE BKP)

Create script on server

/root/mongo_bkp.sh

rm -rf /root/dump* && mongodump && tar -cvf dump.tar dump/

Exec script

ssh user@machine /root/mongo_bkp.sh

WKWebView support for Cordova just landed, and we'd love your help testing how it works with Ionic 1.2.

Getting Started

Make sure you have Cordova 5.4.1, if not do npm install -g cordova

Make sure you have ios-deploy 1.8, if not do npm install -g ios-deploy

Start a new Ionic project:

@romuloctba
romuloctba / index.js
Created December 14, 2015 12:44 — forked from cristopher-rodrigues/index.js
mongo index text search
//For a specified field
db.collectionname.createIndex(
{ "field_name": "text" },
{ name: "TextIndex" }
)
//For All Fields
db.collectionname.createIndex(
{ "$**": "text" },
{ name: "TextIndex" }
@romuloctba
romuloctba / functions.php
Created April 12, 2016 20:30 — forked from fdaciuk/functions.php
Adicionar mais campos no perfil de usuário do WordPress
<?php
add_filter( 'user_contactmethods', 'add_new_user_fields' );
function add_new_user_fields( $user_contact ) {
$user_contact[ 'billing_cel_phone' ] = 'Celular';
return $user_contact;
}