Skip to content

Instantly share code, notes, and snippets.

View romuloctba's full-sized avatar
:octocat:

RcDev romuloctba

:octocat:
View GitHub Profile
@romuloctba
romuloctba / readme.md
Created March 31, 2016 14:58
Add RSA key to SSH Server
  1. Verifique se já possui chave gerada com cat ~/.ssh/id_rsa.pub
  2. Caso não possua, crie uma com ssh-keygen -t rsa
  3. Execute o comando abaixo, para enviar sua RSA key para o servidor. cat ~/.ssh/id_rsa.pub | ssh user@hostname 'cat >> .ssh/authorized_keys'
@romuloctba
romuloctba / isTouchOrWhat.js
Created March 21, 2016 12:53
Decide for click or touch
var eventDown = 'ontouchstart' in document ? 'touchstart' : 'mousedown';
$(document).bind(eventDown, function(ev) {
//do what you need
})
@romuloctba
romuloctba / factories.js
Last active February 14, 2016 13:16
Ionic ( AngularJS ) Factory with desktop Fallback and DataURI to Blob conversor for Phonegap Camera Plugin
angular.module('myApp')
.factory('Camera', ['$q', function($q) {
return {
getPicture: function(options) {
var q = $q.defer();
if(!window.cordova) {
var fileInput = document.createElement('input');
fileInput.setAttribute('type', 'file');
@romuloctba
romuloctba / howto.md
Created January 19, 2016 14:20
Sending XHR request before user leaves pages

Simply add a sleep function like

 function sleep(milliseconds) {
    var start = new Date().getTime();
    for (var i = 0; i < 1e7; i++) {
      if ((new Date().getTime() - start) > milliseconds){
        break;
 }
@romuloctba
romuloctba / howto.md
Created January 6, 2016 23:34
Android 4.0.3 with Ionic Framework

I want to make Ionic Framework projects work on Android 4.0.3

  • Android 4.0.3 is API Lvl 15, download it via ADV

  • npm install -g [email protected] (Newer versions may not work with android-15)

  • ionic platform add android

  • edit config.xml > ``

@romuloctba
romuloctba / social_meta_tags.html
Created December 16, 2015 12:09
Full social meta tags for products
<!-- Update your html tag to include the itemscope and itemtype attributes. -->
<html itemscope itemtype="http://schema.org/Product">
<!-- Place this data between the <head> tags of your website -->
<title>Page Title. Maximum length 60-70 characters</title>
<meta name="description" content="Page description. No longer than 155 characters." />
<!-- Schema.org markup for Google+ -->
<meta itemprop="name" content="The Name or Title Here">
<meta itemprop="description" content="This is the page description">
@romuloctba
romuloctba / social_meta_tags.html
Created December 16, 2015 12:09
Willian Justen's social meta tags
<meta property="fb:admins" content="id do seu fb insight">
<meta property="og:url" content="url do seu site">
<meta property="og:type" content="tipo do link, article, page, etc">
<meta property="og:title" content="título do site">
<meta property="og:image" content="imagem do site (LINK ABSOLUTO)">
<meta property="og:description" content="breve descrição">
<meta property="og:site_name" content="Nome do site">
<meta property="article:author" content="fb de quem escreveu">
<meta property="article:publisher" content="fb de quem publicou">
<meta property="article:published_time" content="momento de publicação">
@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" }

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 / readme.md
Last active July 17, 2024 22:24
Install Adobe Photoshop CS6 on Wine (Ubuntu, Elementary OS, Linux Mint)

Step 1. Install the Wine Team Ubuntu PPA

First start by installing Wine btw it's a utility to install windows apps in linux :

open the Terminal and :

   sudo add-apt-repository ppa:ubuntu-wine/ppa     
   sudo apt-get update && sudo apt-get upgrade
   sudo apt-get install wine1.7 winetricks