Skip to content

Instantly share code, notes, and snippets.

@bytefade
bytefade / info.php
Created July 29, 2015 01:31
Info User
<?php
$msg .= "---Informações de usuários--- \n"."<br>"; //Título
$msg .= "Data/hora : ".date('d/m/Y H:i:s')."\n"."<br>"; //IP do remetente
$msg .= "IP do usuário : ".$_SERVER["REMOTE_ADDR"]."\n"."<br>"; //IP do remetente
$msg .= "userAgent : ".$browser['userAgent']."\n"."<br>"; //User Agent
$msg .= "name : ".$browser['name']."\n"."<br>"; //User Agent
$msg .= "version : ".$browser['version']."\n"."<br>"; //User Agent
$msg .= "platform : ".$browser['platform']."\n"."<br>"; //User Agent
$msg .= "pattern : ".$browser['pattern']."\n"."<br>"; //User Agent
$msg .= "Envio apartir de : ".$_SERVER["HTTP_REFERER"]."<br>"; //Referências
@bytefade
bytefade / getBrowser.php
Created July 29, 2015 00:35
get browser and Other...
<?php
function getBrowser()
{
$u_agent = $_SERVER['HTTP_USER_AGENT'];
$bname = 'Unknown';
$platform = 'Unknown';
$version= "";
//First get the platform?
@bytefade
bytefade / sublime.config
Created June 27, 2015 22:11
sublime packege
{
"auto_upgrade_last_run": null,
"in_process_packages":
[
],
"installed_packages":
[
"AdvancedNewFile",
"All Autocomplete",
"Alternative Autocompletion",
{
"auto_complete": true,
"auto_complete_commit_on_tab": true,
"auto_complete_delay": 5,
"auto_complete_selector": "source - comment",
"auto_complete_size_limit": 4194304,
"auto_complete_triggers":
[
{
"characters": "<",
@bytefade
bytefade / git-stash
Created June 19, 2015 17:57
Git stash, quando você trabalha em branch errado.
$ git stash
$ git stash branch temporario
$ git checkout nova-consulta
$ git merge --no-ff temporario
$ git branch -d temporario
Com o git stash eu peguei minhas mexidas e guardei em lugar seguro. Nisso, o master voltou a ficar com o conteúdo correto. Ufa!
Com o git stash branch temporario eu criei um branch com elas, de nome temporario.
Com o git checkout eu entrei no branch correto, nova-consulta
Com o git merge eu peguei a minha mexida, que agora está no branch temporario, e incorporei ao branch correto (nova-consulta) :-)
@bytefade
bytefade / replaceSQL.sql
Created June 1, 2015 13:50
Replace direto via SQL
update table1
set phone = replace(phone, '-', '');
<?php
# Load slim WP
define( 'WP_USE_THEMES', false );
require( './wp-load.php' );
# http://phpexcel.codeplex.com/
require_once dirname(__FILE__) . '/Classes/PHPExcel.php';
global $wpdb;
$query = "SELECT * FROM $wpdb->comments
#!/bin/sh
# Sublime Text 3 install with Package Control (last update: 4 April 2015)
#
# No need to download this script, just run it on your terminal:
#
# $ curl -L git.io/sublimetext | sh
#
# When you need to update Sublime Text, run this script again.
# Local Dates:
git log --date=local --pretty=format:"%h%x09%an%x09%ad%x09%s" > commits.local.tsv.txt
# ISO Dates:
git log --date=iso --pretty=format:"%h%x09%an%x09%ad%x09%s" > commits.iso.tsv.txt
@bytefade
bytefade / find_table.js
Created April 29, 2015 14:29
find table - busca rapida em tabelas de html
$( document ).ready(function() {
// Handler for .ready() called.
$("#textFind").keyup(function()
{
$('tbody').css('display', 'block');
$('table.table tbody tr td').removeClass('marcado');
$('table.table tbody tr').removeClass('remover');
stringPesquisa = $("#textFind").val();