This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Get postman app | |
wget https://dl.pstmn.io/download/latest/linux64 -O postman.tar.gz | |
sudo tar -xzf postman.tar.gz -C /opt | |
sudo ln -s /opt/Postman/Postman /usr/bin/postman | |
#Create a Desktop Entry | |
cat > ~/.local/share/applications/postman.desktop <<EOL | |
[Desktop Entry] | |
Encoding=UTF-8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Below is a full tutorial on how to setup and use Googles Firebase push notification API for both Android and iOS. It is based on this | |
earlier implementation of Googles GCM method: https://gist.github.com/prime31/5675017 - FCM is the new method and GCM will eventually be | |
retired. | |
## THE BELOW METHOD IS THE NEWER FCM METHOD: | |
Register your app in the FCM Console: https://console.firebase.google.com (add project) | |
1. Click on the newly added project, in the upper left menu is the "Overview" and Gear Settings. | |
2. Click on the GEAR settings icon, and then on "Project Settings" | |
3. In the main screen, click on "Cloud Messaging" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Levenshtein function | |
-- Source: https://openquery.com.au/blog/levenshtein-mysql-stored-function | |
-- Levenshtein reference: http://en.wikipedia.org/wiki/Levenshtein_distance | |
-- Arjen note: because the levenshtein value is encoded in a byte array, distance cannot exceed 255; | |
-- thus the maximum string length this implementation can handle is also limited to 255 characters. | |
DELIMITER $$ | |
DROP FUNCTION IF EXISTS LEVENSHTEIN $$ | |
CREATE FUNCTION LEVENSHTEIN(s1 VARCHAR(255) CHARACTER SET utf8, s2 VARCHAR(255) CHARACTER SET utf8) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Installation --- | |
# 1. In Bitbucket, add FTP_USERNAME, FTP_PASSWORD and FTP_HOST as environment variables. | |
# 2. Commit this file (bitbucket-pipelines.yml) to your repo (in the repo root dir) | |
# 3. From Bitbucket Cloud > Commits > Commit Number > Run Pipeline > Custom:Init (this will | |
# push everything and initialize GitFTP) | |
# | |
# Usage --- | |
# - On each commit to master branch, it'll push all files to the $FTP_HOST | |
# - You also have the option to 'init' (see 'Installation' above) - pushes everything and initialises | |
# - Finally you can also 'deploy-all' (from Bitbucket Cloud > Commits > Commit Number > Run Pipeline > Custom:deploy-all) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For example, run "npm install" | |
docker run -v "$PWD":/usr/src/app -w /usr/src/app node:4 npm install | |
# This command creates a container (downloading one first if you don't have it locally), runs the command in a current directory and quits the container | |
# Great Success! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Adicione um novo remote; pode chamá-lo de "upstream": | |
git remote add upstream https://github.com/usuario/projeto.git | |
# Obtenha todos os branches deste novo remote, | |
# como o upstream/master por exemplo: | |
git fetch upstream |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Bcrypt hashing class | |
* | |
* @author Thiago Belem <[email protected]> | |
* @link https://gist.github.com/3438461 | |
*/ | |
class Bcrypt { |