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
// drawnImage : UIImage | |
let imgData = drawnImage.jpegData(compressionQuality: 1.0) | |
let base64 = imgData?.base64EncodedString() |
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
import UIKit | |
extension UIImage { | |
public func imageRotatedByDegrees(degrees: CGFloat, flip: Bool) -> UIImage { | |
let radiansToDegrees: (CGFloat) -> CGFloat = { | |
return $0 * (180.0 / CGFloat.pi) | |
} | |
let degreesToRadians: (CGFloat) -> CGFloat = { | |
return $0 / 180.0 * CGFloat.pi |
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 SERIAL in $(adb devices | grep -v List | cut -f 1); do adb -s $SERIAL install -r nome-do-arquivo-do-app.apk; done |
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 | |
header('Content-Type: application/json'); | |
$body = file_get_contents("php://input"); | |
$bodyjson = json_decode($body); | |
$number1 = $bodyjson->queryResult->parameters->number1; | |
$number2 = $bodyjson->queryResult->parameters->number2; | |
$action = $bodyjson->queryResult->action; | |
$result = 0; |
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/sh | |
# | |
# chkconfig: - 80 45 | |
# description: Starts and stops Kong | |
# Enable: http://manpages.ubuntu.com/manpages/zesty/man8/update-rc.d.8.html | |
# update deamon path to point to the kong executable | |
start() { | |
echo -n "Starting Kong... " | |
kong start |
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
find . -type f -size +512M -exec ls -lh {} \; |
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
echo "FRASE" | tr 'A-Z' 'a-z' |
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
sudo du -hsx * | sort -rh | head -10 |
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
mysqldump database_name_1 \ | |
--host=address_1 \ | |
--port=3306 \ | |
--user=username_1 \ | |
--password=password_1 \ | |
--single-transaction \ | |
--compress \ | |
--no-create-db \ | |
--skip-add-locks \ | |
--skip-comments | mysql \ |
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
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password'; |