Skip to content

Instantly share code, notes, and snippets.

Deyvid Nascimento deyvin

Block or report user

Report or block deyvin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View project.rb
puts "w h a t s a p p"
puts "22981691431"
View transacao_firebird_php.php
<?php
$db = ibase_connect ('localhost:/usr/db/db.gdb', 'SYSDBA', 'masterkey');
$tr = ibase_trans( IBASE_DEFAULT, $tr ); #abre a transação do firebird
$insert = "INSERT INTO CLIENTES (ID, NOME) VALUES (1, 'JOSE')";
ibase_query($tr, $insert);
$insert = "INSERT INTO CLIENTES (ID, NOME) VALUES (1, 'JOSE')";
@deyvin
deyvin / acrescimo.php
Last active Jan 4, 2016
Como chegar a um valor de acréscimo aplicando um percentual de desconto para chegar ao valor fixo.
View acrescimo.php
<?php
$valor_desejado = 500;
$percentual = 20;
echo ($valor_desejado * 100) / (100$percentual);
View sum_rand_values_php.php
<?php
define('TOTALAPLICADO', 1000);
define('PERC_RENDIMENTO', 15);
define('DIAS', 31);
$total_por_dia = ((TOTALAPLICADO * PERC_RENDIMENTO) / 100) / DIAS;
@deyvin
deyvin / mysql_count_all_tables.php
Created Oct 17, 2013
Dynamic sql count - all mysql database tables
View mysql_count_all_tables.php
<?php
mysql_connect("localhost", "root", "1234");
$banco = 'ecommerce';
$db_selected = mysql_select_db($banco);
$result = mysql_query('SHOW TABLES');
while($row = mysql_fetch_assoc($result)) {
@deyvin
deyvin / ecommerce.rb
Last active Dec 20, 2015
Script para pesquisar preço dos ecommerce a partir do código interno do produto
View ecommerce.rb
require 'nokogiri'
require 'open-uri'
require 'mysql2'
class Ecommerce
attr_accessor :id, :name, :price, :bank_price, :con
@@con = Mysql2::Client.new(:host => 'localhost', :username => 'root', :password => '1234', :database => 'ecommerce')
def acessar_site(url)
Nokogiri::HTML(open(url, :proxy_http_basic_authentication => ['http://192.168.254.200:8080', 'deyvin', 'fdcsistemas123'] ))
View bebeu_agua.php
<?php
$bebeu_agua = "Não";
$ta_com_sede = "To";
if($bebeu_agua == "Não") {
if($ta_com_sede == "To") {
echo "Água, Água, Água mineral, Água mineral...";
}
}
@deyvin
deyvin / dynamic_thumbnail_with_php.php
Created Jan 14, 2013
This script is a perfect method to create thumbnail with uploaded images. Enjoy us!
View dynamic_thumbnail_with_php.php
<?php
# ----------------------------------------------------------------------
# DFN Thumbnailer
# http://www.digifuzz.net
# digifuzz@gmail.com
# ----------------------------------------------------------------------
# Constants
View relative_time.php
<?php
function plural($num) {
if ($num != 1)
return "s";
}
function getRelativeTime($date) {
$diff = time() - strtotime($date);
@deyvin
deyvin / php_shell_color.php
Created May 7, 2012
shell colors with php
View php_shell_color.php
<?php
# first define colors to use
$_colors = array(
LIGHT_RED => "[1;31m",
LIGHT_GREEN => "[1;32m",
YELLOW => "[1;33m",
LIGHT_BLUE => "[1;34m",
MAGENTA => "[1;35m",
LIGHT_CYAN => "[1;36m",
WHITE => "[1;37m",
You can’t perform that action at this time.