Category: Programmer
Add Jira Issue Number on the commit message
According to this snippet: Now anytime you checkout a repo OR use git init in a directory, the prepare-commit-msg will be copied into your project’s .git/hooks folder. Note: You can safely run git init within pre-existing git projects to get the file copied over Credits to Jonathan Doklovic
Restore Backup from Duplicity in Azure
Upgrade DBeaver Community with HomeBrew
HTML Entities Reference
https://dev.w3.org/html5/html-author/charref
Delete all local untracked branches from GIT
The post provides handy commands for cleaning up merged and closed branches in GIT. The main command removes all such branches automatically. However, for branches not fully merged, they will need to be manually deleted through a separate command, thereby helping maintain an organized GIT repository.
Jenkins configuration for Nginx reverse proxy
In this configuration, everything works fine and you won’t see the error. “It appears that your reverse proxy set up is broken” Note that on line 31, the addresses don’t have slash (/) at the end. This is the correct configuration.
Error on Windows Server 2016 Language Settings
The following error appears when you try to put a new language on windows server: Windows cannot access the specified device, path or file. You may not have the appropriate permissions to access the item. Steps to solve this problem: Win + R and type ‘secpol.msc’ for open the Local Security Policy console. In the…
Import Database from Backup File on SQL Server for Linux / Docker
Install Duplicity on Ubuntu Linux and use Azure Storage as backup destination
Use the following code to install Duplicity to backup the files to Azure Backup Now you can use the command to run duplicity backup: duplicity full /source/dir azure://containername See the reference on this page.
SSL Server Test
https://www.ssllabs.com/ssltest/
Flush Cache OS X Sierra
sudo killall -HUP mDNSResponder sudo killall mDNSResponderHelper sudo dscacheutil -flushcache
SQL Client for Mac
https://dbeaver.jkiss.org/ With DBeaver you can run the same as SQL Server Management Studio on a Mac or Linux. With very good integration and drivers automatically downloaded.
Remover Arquivo com Caracteres não Permitidos no Windows
No prompt de comando, dê um comando: dir /x Aparecerá a listagem de arquivos. Depois pegue o nome curto do arquivo ou pasta (onde está marcado em laranja) e use para arquivos del NOMEAR~1 ou para diretórios rmdir NOMEPA~1
Buscar Valor em Array Multidimensional no PHP
No meu dia a dia de programação, me deparei com o problema de ter que checar se um valor existe numa array multidimensional. No help do PHP tinham alguns snippets, mas não resolviam o problema onde a chave da array era uma string. Logo fiz o seguinte código e deixo ele para quem quiser melhorar.…
Cordova Email Composer não funciona no Android
Para funcionar baixe a versão 0.8.2 em: sudo cordova plugin add https://github.com/katzer/cordova-plugin-email-composer.git#0.8.2 –save
Usando Google Analytics no Ionic
Código para Configuração (app.js) function _waitForAnalytics() { if (typeof analytics !== ‘undefined’) { $cordovaGoogleAnalytics.startTrackerWithId(‘UA-80968008-1’); } else { setTimeout(function() { _waitForAnalytics(); }, 250); } }; _waitForAnalytics(); Código para Acompanhamento de Página function _waitForAnalytics() { if (typeof analytics !== ‘undefined’) { $cordovaGoogleAnalytics.trackView(‘Home’); } else { setTimeout(function() { _waitForAnalytics(); }, 250); } }; _waitForAnalytics();
Remover Node.js do Mac
sudo rm -rf /usr/local/{lib/node{,/.npm,_modules},bin,share/man}/{npm*,node*,man1/node*}
Uninstalling Java JDK MacOS
To uninstall the JDK, you must have Administrator privileges and execute the remove command either as root or by using the sudo tool. Navigate to /Library/Java/JavaVirtualMachines and remove the directory whose name matches the following format: /Library/Java/JavaVirtualMachines/jdkmajor.minor.macro[_update].jdk For example, to uninstall 8u6: % rm -rf jdk1.8.0_06.jdk Do not attempt to uninstall Java by removing the…
Elevar para usuário root no terminal do MacOS
Basta você usar o seguinte código:
Como remover o Android Studio do Mac
Siga os seguintes passos no terminal: Se você quer apagar todos os projetos: Para remover arquivos relacionados ao gradle (caches & wrapper) Use o comando abaixo para apagar todos os Android Virtual Devices(AVDs) e *.keystore. Nota: Esta pasta é utilizada por outras Android IDE, então se você ainda estiver usando outra IDE, não apague esta pasta)…