This file contains hidden or 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
jQuery.fn.ForceNumericOnly = function() { | |
return this.each(function() | |
{ | |
$(this).keydown(function(e) | |
{ | |
var key = e.charCode || e.keyCode || 0; | |
// allow backspace, tab, delete, arrows, ctrl + a, numbers and keypad numbers ONLY | |
return ( | |
key == 8 || | |
key == 9 || |
This file contains hidden or 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
chavao@ubuntu:~/Desktop/Simplate (master)$ phpunit --configuration tests/phpunit.xml | |
PHP Fatal error: Uncaught exception 'RuntimeException' with message 'Cannot open file "bootstrap.php". | |
' in /usr/share/php/PHPUnit/Util/Fileloader.php:108 | |
Stack trace: | |
#0 /usr/share/php/PHPUnit/TextUI/Command.php(786): PHPUnit_Util_Fileloader::load('bootstrap.php') | |
#1 /usr/share/php/PHPUnit/TextUI/Command.php(156): PHPUnit_TextUI_Command->handleArguments(Array) | |
#2 /usr/share/php/PHPUnit/TextUI/Command.php(147): PHPUnit_TextUI_Command->run(Array, true) | |
#3 /usr/bin/phpunit(52): PHPUnit_TextUI_Command::main() | |
#4 {main} | |
thrown in /usr/share/php/PHPUnit/Util/Fileloader.php on line 108 |
This file contains hidden or 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
function runArray(arr, callback) { | |
for(i in arr) { | |
callback(arr[i]); | |
} | |
} | |
a = ['alfa', 'beta', 'delta', 'omega']; | |
runArray(a, function(val) { | |
alert(val); |
This file contains hidden or 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
$.fn.invertOnClick = function(context) { | |
return this.click(function(e) { | |
e.preventDefault(); | |
context.each(function(i) { | |
if($(this).is(':visible')) | |
{ | |
var inputCheck = $(this).find('input[type=checkbox]'); |
This file contains hidden or 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
chavao@ubuntu:~/Desktop/cpp/proj$ g++ -c -g rumo.cpp | |
chavao@ubuntu:~/Desktop/cpp/proj$ g++ -g -g main.cpp | |
main.cpp: In function ‘int main()’: | |
main.cpp:8: error: aggregate ‘Rumo r’ has incomplete type and cannot be defined | |
chavao@ubuntu:~/Desktop/cpp/proj$ |
This file contains hidden or 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
#include <iostream> | |
#include "rumo.h" | |
using namespace std; | |
int main() | |
{ | |
Rumo r; | |
// Definindo um valor qualquer para "Rumo" | |
r.setValor(70); |
This file contains hidden or 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 | |
class FileUploadComponent extends Component { | |
public $allowedTypes; | |
public $maxSize; | |
private $tmpFile; | |
public $uploadPath; | |
public function __construct() { |
This file contains hidden or 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 | |
# | |
# Elimina os arquivos com mais de 3 dias; | |
# | |
for d in /home/chavao/Desktop/temp; do | |
find $d -type f -mtime +3 -exec rm --force "{}" \; | |
# | |
# Removemos os diretóios vazios |
This file contains hidden or 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 | |
function get_data_uri($image_path) { | |
return 'data: '.mime_content_type($image_path).';base64,'.base64_encode(file_get_contents($image_path)); | |
} |
This file contains hidden or 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
SNR Margin - Relação Sinal ruído: | |
- 5db ou menos = ruim, impossível sincronia, quedas frequentes | |
- 8db-13db = regular - sem problemas com sincronia do modem | |
- 14db-22db = muito bom | |
- 23db-28db = excelente | |
- 29db-35db = raro | |
Atenuação: |