Skip to content

Instantly share code, notes, and snippets.

sudo du -hsx * | sort -rh | head -10
echo "FRASE" | tr 'A-Z' 'a-z'
find . -type f -size +512M -exec ls -lh {} \;
<?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;
for SERIAL in $(adb devices | grep -v List | cut -f 1); do adb -s $SERIAL install -r nome-do-arquivo-do-app.apk; done
@douglascabral
douglascabral / ImageRotate.swif
Created November 22, 2018 20:26
Rotate UIImage
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
@douglascabral
douglascabral / ImageToBase64.swift
Created November 22, 2018 20:40
Transform UIImage to Base64
// drawnImage : UIImage
let imgData = drawnImage.jpegData(compressionQuality: 1.0)
let base64 = imgData?.base64EncodedString()
for line in `cat file.csv | sed -e 's/\r//g'`; do qrencode -o ${line}.png -s 10 ${line}; done
[XDebug]
zend_extension = "c:\xampp\php\ext\php_xdebug.dll"
xdebug.remote_autostart = 1
xdebug.profiler_append = 0
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = "c:\xampp\tmp"
;xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
@douglascabral
douglascabral / function.php
Created June 25, 2020 00:32 — forked from mattclements/function.php
Wordpress Disable Comments (add to function.php)
<?php
add_action('admin_init', function () {
// Redirect any user trying to access comments page
global $pagenow;
if ($pagenow === 'edit-comments.php') {
wp_redirect(admin_url());
exit;
}