Skip to content

Instantly share code, notes, and snippets.

View mandado's full-sized avatar

Jorge Roberto Tomaz Junior mandado

  • Juiz de Fora - Minas Gerais
View GitHub Profile
<?php
function base64($file, $mime) {
$contents = file_get_contents($file);
$base64 = base64_encode($contents);
return "data:$mime;base64,$base64";
}
@mandado
mandado / jquery.hotspot.prototipo.js
Created October 12, 2013 16:40
Protótipo plugin jquery hotspot
/*
* jQuery Boilerplate - v3.3.1
* A jump-start for jQuery plugins development.
* http://jqueryboilerplate.com
*
* Made by Zeno Rocha
* Under MIT License
*/
// the semi-colon before function invocation is a safety net against concatenated
// scripts and/or other plugins which may not be closed properly.
apt-get install php5-mysql php5-curl php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-mhash php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl php5-json
@mandado
mandado / trabalho1.c
Last active December 27, 2015 19:59
Primeiro t rabalho em c da faculdade.
#include <stdio.h>
#include <stdlib.h>
int verificaCoordenadas(int coordx0,int coordx1,int coordy0,int coordy1){
int condicaox = (coordx0 >= 0 && coordx0 < coordx1 && coordx1 <= 1000 && coordx0 <= 1000);
int condicaoy = (coordy0 >= 0 && coordy0 < coordy1 && coordy1 <= 1000 && coordy0 <= 1000);
int ok;
if (condicaox == 1 && condicaoy == 1)
{
return 1;
}
@mandado
mandado / bafo.c
Last active December 27, 2015 20:59
segundo trabalho em c da faculdade
#include <stdio.h>
#include <stdlib.h>
int verificaQuantidadeDeRodadas(int quantidade){
int condicaoQuantidade = (quantidade >= 1 && quantidade <= 1000);
if(condicaoQuantidade == 1){
return 1;
}
return 0;
}
int verificaQuantidadeDeFigurinhas(int quantidade){
@mandado
mandado / slug.php
Last active December 28, 2015 05:59
Função para gerar slug igual o wordpress; Créditos do Wordpress e o site : http://desenvolvimentoparaweb.com/php/urls-amigaveis-slug-a-wordpress/
<?php
class Slug{
/*
* funcoes para gerar slug , base: wordpresss
*/
private static function utf8_uri_encode( $utf8_string, $length = 0 ) {
$unicode = '';
$values = array();
$num_octets = 1;
$unicode_length = 0;
Fatal error: Uncaught exception 'PagSeguroServiceException' in C:\xampp2\htdocs\franklinhome\PagSeguroLibrary\service\PagSeguroPaymentService.class.php:95 Stack trace: #0 C:\xampp2\htdocs\franklinhome\PagSeguroLibrary\domain\PagSeguroPaymentRequest.class.php(626): PagSeguroPaymentService::createCheckoutRequest(Object(PagSeguroAccountCredentials), Object(PagSeguroPaymentRequest)) #1 C:\xampp2\htdocs\franklinhome\templates\pagamento.php(64): PagSeguroPaymentRequest->register(Object(PagSeguroAccountCredentials)) #2 C:\xampp2\htdocs\franklinhome\templates\layout.php(240): include('C:\xampp2\htdoc...') #3 C:\xampp2\htdocs\franklinhome\index.php(6): include('C:\xampp2\htdoc...') #4 {main} thrown in C:\xampp2\htdocs\franklinhome\PagSeguroLibrary\service\PagSeguroPaymentService.class.php on line 95.
<?php
/*
|--------------------------------------------------------------------------
| Delete form macro
|--------------------------------------------------------------------------
|
| This macro creates a form with only a submit button.
| We'll use it to generate forms that will post to a certain url with the DELETE method,
| following REST principles.
<?php
View::composer(Paginator::getViewName(), function($view) {
$query = array_except( Input::query(), Paginator::getPageName() );
$view->paginator->appends($query);
});
@mandado
mandado / notificacaoubuntu.sh
Last active January 4, 2016 03:49
Notificação no ubuntu
#!/bin/bash
notify-send -u critical -i "notification-message-IM" 'Minha notificação' 'Criando minha primeira notificação com Ubuntu'
notify-send -u critical -i 'notification-message-email' 'Minha notificação' 'Criando minha primeira notificação com Ubuntu'