domingo, 1 de maio de 2016

how to map an image using html with the area tag?

Hi :)

I'm going to show you how to use the area tag to create a map of links in an html image.

It is very simple, you just need:

- to have an image where you will set the "usemap" attribute with your map's name
- to define the areas and the links inside of a map tag

Just like that:

<img src="url/to/your/image.jpg" usemap="#Map" />

<map name="Map" id="Map">
    <area href="#url1" shape="rect" coords="0,0,250,250" />
    <area href="#url2" shape="rect" coords="251,0,500,250" />
</map>

In this example I have an image with width=500px and heigth=250px
and the left half is a link to #url1
and the right half is a link to #url2

But I recommend you using a tool to generate these areas. That is a good tool: http://imagemap-generator.dariodomi.de/

---------------

If you want to learn more: http://www.w3schools.com/tags/tag_area.asp

---------------

And when you use a map, maybe you will see a blue border around your areas, if you want to remove these borders just put this code in your CSS:

map area{
    outline: none;
}

or just add
style="outline: none"
in each area that you create

---------------

And you can use another shapes instead using a rectangle, but I won't show here how to do that :(

---------------

That's all!
Adriano Schmidt

Retirar logo da Loja Integrada do rodapé

Bom, não é legalmente permitido isso, conforme mostrado nessa FAQ, porém, é útil mostrar isso para outras funcionalidades que vou mostrar a seguir.

Para retirar o logo da loja integrada do rodapé você pode adicionar esse código abaixo no "Editar CSS" da sua loja:

#rodape div .conteiner .row-fluid .span2 {
      visibility: hidden; display: none;
}


Mas não faça isso, não é permitido... porém mostrei pois da mesma forma, você pode fazer outras coisas como retirar o logo do "Integrando-se", empresa que vende temas, mas ao invés daquele código, use esse:

.integrandose {
      visibility: hidden; display: none!important;
}

Att,
Adriano Schmidt

quarta-feira, 6 de abril de 2016

Adobe Photoshop CC - How to change language to english

Hii,

I've installed the Adobe Photoshop CC on my PC, but it was in portuguese and some translations aren't so good, so I wanted to change the language to english.

It is very easy, just follow these steps:

- Quit Photoshop (if it is opened)
- Go to the installation directory and go to <installation folder>\Locales\<pt_BR or the other installed language>\Support Files
- Rename the file "tw10428.dat" to "tw10428.bak"
- Open the Photoshop again

That's it. Very simple.

Best regards,
Adriano Schmidt

domingo, 3 de abril de 2016

Ionic - Timeout

Hi, I will show here how to use the $timeout with Ionic:

Create a variable:
var myTimeout;

Start the timeout:
myTimeout = $timeout(timeIsOver, 10000);
The first parameter is a the function that will be executed after the time that you will set in the second parameter. In this case, 10000 milliseconds (10 seconds)


And do something when the time is over:
function timeIsOver(){
    console.log('timeIsOver');
}

And if, before the time ends, you want to cancel the timeout for not executing the timeIsOver function, just do that:
timeout.cancel(myTimeout);

Thats it :)

Best regards,
Adriano Schmidt

Ionic - How to scroll programatically?

Hii,

If you are in a Ionic project and you want to move your screen (to scroll it) to the top or to the bottom, you just need to receive the $ionicScrollDelegate and call the methods scrollTop or scrollBottom:

angular.module('mymodule').controller('MyCtrl', function($scope, $ionicScrollDelegate) {

$ionicScrollDelegate.scrollTop();

$ionicScrollDelegate.scrollBottom();

That's it :)

Best regards,
Adriano Schmidt

sexta-feira, 1 de abril de 2016

ionic build android does not update apk files

Hi there,

I ran the command "ionic build android" but the apk files at 'platforms/android/build/outputs/apk' folder were not updated

It started to happen after the crosswalk plugin installation

So, I ran the command "ionic state restore" to delete and fetch the plugins of my package.json and to add the platforms (android and/or ios) again.

After that, when I ran "ionic build android" the apk files were updated, but I realized that I should not use the "android-debug.apk" file like I was used to. Now I must use "android-armv7-debug.apk" or "android-x86-debug.apk" regarding the cell phone processor (ARM or x86).

If you don't know your cell phone processor, try one of the files and if it is the wrong file then a message will be showed to you, and you will close the app, uninstall it, and install it again but with the other file.

These are the commands I am using now:
ionic build android
adb.exe install -r platforms/android/build/outputs/apk/android-armv7-debug.apk

Best regards,
Adriano Schmidt

quarta-feira, 23 de março de 2016

$http get ionic não fuciona no celular

Opa :)

Todos os meus $http.get e $http.post pararam de funcionar quando eu rodava no celular, mas no "ionic serve" estava ok... isso aconteceu depois que subi a versão do cordova...

Para resolver, foi preciso instalar esse plugin:

    cordova plugin add cordova-plugin-whitelist

Ao fazer isso, funcionou perfeitamente.

Fonte: http://stackoverflow.com/questions/30389825/angular-ionic-http-get-not-working-in-real-device-ios

Abraço!
Adriano Schmidt

terça-feira, 15 de março de 2016

has no method 'requestfilesystem'

Olá :D

Hoje no meu projeto ionic aconteceu o erro:
    has no method 'requestfilesystem'

Primeiro de tudo.. se você tentar usar o window.requestFileSystem ou qualquer plugin para acessar arquivos ou fazer download ou upload, não use de forma alguma: ionic serve, ionic view, ionic live-reload, -l, phonegap build

Esses plugins só funcionam em dispositivos reais... talvez no emulador funcione, não cheguei a testar.

Bom, se mesmo assim você ainda estiver com o erro, provavelmente você precisa instalar esse plugin:
    cordova plugin add org.apache.cordova.file

Abraço!!!
Adriano Schmidt

Device communication timed out. Try unplugging & replugging the device

Olá :D

Não estava conseguindo rodar meu projeto ionic no celular (ionic run android)

Dava esse erro da imagem (Device communication timed out. Try unplugging & replugging the device)

Tentei desplugar e plugar o celular.. reiniciei o notebook, reiniciei o celular... nada funcionou!
Teve uma época q quando dava esse erro, eu tentava mais umas 3 vezes q voltava a funcionar... agora posso tentar 1000 mil vezes q sempre dá erro...

Pelo fato de eu estar no Windows, acredito q possa ser algo do adb, alguma coisa de driver talvez....



Achei duas soluções para o problema:

Usei o Ionic View: É muito legal e fácil de usar. Você faz upload da sua app para o Ionic Apps, e no seu celular com a app do IonicView você consegue acessar todas as suas apps (Você pode testar num iphone sem ter um Mac).

Mas com o Ionic View você ainda tem as mesmas limitações do Ionic Serve... Você não consegue testar todos os plugins do Cordova por exemplo.

Então consegui rodar a minha app diretamente no celular através dos seguintes comandos:

ionic build android
adb.exe install -r platforms/android/build/outputs/apk/android-debug.apk

Se não encontrar o adb.exe coloque no seu PATH: <ANDROID_SDK>\platform-tools

Fontes:
https://www.facebook.com/groups/1558333777738228/permalink/1693011350937136/
https://www.thepolyglotdeveloper.com/2014/09/manage-files-in-android-and-ios-using-ionicframework/


É isso aí, vaaaleu!!!
Adriano Schmidt

Split MySQL

Opa :D

Eu tinha uma coluna chamada coluna_ids que continha o valor "172:536"... e eu precisava quebrar esse valor em antes e depois do sinal de dois pontos.

Para pegar o valor antes dos dois pontos eu usei:
select id from tabela where value_id = SUBSTRING_INDEX(SUBSTRING_INDEX(coluna_ids, ':', -1), ':', 1) ))

Para pegar o valor depois dos dois pontos eu usei:
select id from tabela where value_id = SUBSTRING_INDEX(SUBSTRING_INDEX(coluna_ids, ':', 1), ':', 1) ))

Fonte: https://gustavostraube.wordpress.com/2012/12/14/split-string-no-mysql/

Abraço!
Adriano Schmidt