Skip to content

Instantly share code, notes, and snippets.

@pedrokoblitz
pedrokoblitz / tabela.js
Last active October 26, 2015 21:57
esconde o link da tabela
/**
* checa se o username é igual ao do avaliador
* @param {string} username [description]
* @param {string} fieldText [description]
* @return {boolean}
*/
var checkUsername = function (username, avaliadores) {
return ! avaliadores.indexOf(username) > -1;
};
-- SYS
DROP TABLE IF EXISTS `types`;
CREATE TABLE `types` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`item_name` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
`name` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
UNIQUE(`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
(function(exports) {
function WPForm() {
this.formEl = '';
this.messagesEl = '';
this.validationRules = {};
this.payload = {};
this.messages = [];
}
<?php
// template
// Usually you want to replace the following static array
// with a dynamic one built retrieving users from the database
$users = array(
array(
"fullname" => "Aurelio De Rosa",
"operations" => 100,
#!/bin/bash
readonly WORKING_DIR=$(pwd)
readonly CONVERSION_DIR=/tmp/conversion
readonly LOG_FILE=$WORKING_DIR/conversion.log
remove_base_dir() {
local SED_BUFFER=/tmp/sed.buffer
echo $1 > $SED_BUFFER
sed -e 's/\/home\/pedro//g' $SED_BUFFER
@pedrokoblitz
pedrokoblitz / .htaccess
Created November 4, 2014 12:41
htaccess
# Apache Server Configs v2.3.0 | MIT License
# https://github.com/h5bp/server-configs-apache
# (!) Using `.htaccess` files slows down Apache, therefore, if you have access
# to the main server config file (usually called `httpd.conf`), you should add
# this logic there: http://httpd.apache.org/docs/current/howto/htaccess.html.
# ##############################################################################
# # CROSS-ORIGIN RESOURCE SHARING (CORS) #
# ##############################################################################
@pedrokoblitz
pedrokoblitz / pesquisa
Created October 22, 2014 11:21
Pesquisa
Técnicas de Pesquisa
As técnicas de investigação a serem utilizadas em um determinado estudo dependem das especificidades do objeto em análise. Dentre as principais metodologias utilizadas pelo IPO - Instituto Pesquisas de Opinião destacam-se as seguintes técnicas: quantitativas, qualitativas e estudos exploratórios.
Veja abaixo as principais diferenças entre as técnicas quantitativas e qualitativas:
As diferenças básicas entre o método de pesquisa quantitativa e método de pesquisa qualitativa
Etapas do processo de
pesquisa Método pesquisa
quantitativo Método pesquisa
qualitativo
Maturity begins when you can be right without having to prove the other person wrong.
If you're the smartest person in the room, you're probably in the wrong room.
There is nothing noble about being better than your fellow man. Only being better than your former self.
No snowflake feels responsible for the avalanche
Fear... is forward. No one is afraid of yesterday.
@pedrokoblitz
pedrokoblitz / queue.sql
Created July 30, 2014 17:25
mysql queries
create table jobs(
id auto_increment not null primary key,
message text not null,
process_id varbinary(255) null default null,
key jobs_key(process_id)
);
# queue
insert into jobs(message) values('blah blah');
@pedrokoblitz
pedrokoblitz / imagine.php
Created June 24, 2014 17:09
image manipulation
public function show() {
// Begin capturing the byte stream
ob_start();
// generate the byte stream
imagejpeg($this->image, NULL, 100);
// and finally retrieve the byte stream
$rawImageBytes = ob_get_clean();