Skip to content

Instantly share code, notes, and snippets.

View fernandovaller's full-sized avatar
🏠
Working from home

Fernando Valler fernandovaller

🏠
Working from home
View GitHub Profile
@fernandovaller
fernandovaller / Sublime Text 3 - Get and Set
Last active March 4, 2016 15:02
Geração automática dos gets e sets de clases
#Tools > New Snippet
Troque o texto por esse e salve:
<snippet>
<content><![CDATA[public function get${1/(.*)/\u$1/}()
{
return \$this->${1:$SELECTION};
}
@fernandovaller
fernandovaller / gist:69c4a572586f46646453
Created February 29, 2016 16:09 — forked from viniciusteles/gist:556029
Sete Atitudes para Hackear a Indústria de Software
Sete Atitudes para Hackear a Indústria de Software
By Klaus Wuestefeld
1) Torne-se excelente.
Seja realmente bom em alguma coisa. Não fique só choramingando ou
querendo progredir às custas dos outros. Não pense q pq vc sentou 4
anos numa faculdade ouvindo um professor falar sobre software q vc
sabe alguma coisa. Jogador de futebol não aprende a jogar bola tendo
@fernandovaller
fernandovaller / Sublime Text 3 - Identar código
Last active January 13, 2021 22:09
Sublime Text 3 - Identar código
Em Preferences > Key Bindings User
[
{ "keys": ["ctrl+t"], "command": "run_macro_file", "args": {"file": "Packages/User/convert_tabs_to_spaces.sublime-macro"} },
{ "keys": ["ctrl+shift+r"], "command": "reindent" , "args": {"single_line": false}}
]
<?php
function size($size, $precision = 2){
$base = log($size, 1024);
//$suffixes = array('', 'K', 'M', 'G', 'T');
$suffixes = array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
return round(pow(1024, $base - floor($base)), $precision) .' '. $suffixes[floor($base)];
}
@fernandovaller
fernandovaller / List Programs
Created June 9, 2017 15:24
My list program
Firefox;
Chrome;
FileZilla;
@fernandovaller
fernandovaller / gist:d18698463b33703242b4bcd76183e089
Created November 9, 2017 19:54
List of Android "Secret" Codes, Tips, and Tricks
As pointed out from comments these are mostly for Samsung, I have added some for HTC below. Like I said this is just a start we can build form it. If anyone would like to create a Google Doc from this information please feel free I will add a link to this post.
SAMSUNG CODES
Code Description
*#*#4636#*#* Display information about Phone, Battery and Usage statistics
*#*#7780#*#* Restting your phone to factory state-Only deletes application data and applications
*2767*3855# It's a complete wiping of your mobile also it reinstalls the phones firmware
*#*#34971539#*#* Shows completes information about the camera
*#*#7594#*#* Changing the power button behavior-Enables direct poweroff once the code enabled
*#*#273283*255*663282*#*#* For a quick backup to all your media files
*#*#197328640#*#* Enabling test mode for service activity
# Project Title
One Paragraph of project description goes here
## Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
### Prerequisites
#!/bin/bash
USER="zend"
PASSWORD=""
#OUTPUT="/Users/rabino/DBs"
#rm "$OUTPUTDIR/*gz" > /dev/null 2>&1
databases=`mysql -u $USER -p$PASSWORD -e "SHOW DATABASES;" | tr -d "| " | grep -v Database`
Usando o cloud Flare aplicar essa regra
#Se a requisição não for https force https
RewriteCond %{HTTP:X-Forwarded-Proto} =http
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
#se na requisição nao tiver www force www
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
<?php
$a = '
Uma tentativa de estupro foi interrompida quando a mulher recitou a passagem de João 3:16 e orou pelo agressor, livrando-se assim do abuso sexual.
O caso aconteceu na Florida, Estados Unidos, e segundo a polícia, Charlie Christopher Bates foi morto horas depois numa perseguição policial.
A tentativa de estupro se deu quando Charlie invadiu o apartamento de sua vítima, e com uma arma, forçou-a a se despir e acariciá-lo. Quando ele estava prestes a consumar o ato, a vítima recitou um dos versículos mais conhecidos da Bíblia e passou a orar pelo agressor.