Skip to content

Instantly share code, notes, and snippets.

View RoyBellingan's full-sized avatar

Roy Bellingan RoyBellingan

View GitHub Profile
@RoyBellingan
RoyBellingan / gist:5319450
Created April 5, 2013 13:55
Insulto random
alert("Ruben non ha la barca a vela");
@RoyBellingan
RoyBellingan / iframe_template
Last active December 16, 2015 19:51
template iframe for SuperMoney DEM, sostituire le XXXXXX con il nome del sito per poter fare correttamente il tracking. Altrimenti la lead viene persa e gg..
<html>
<head>
<title>Supermoney.eu | Mutui V1</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<script type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? " https://stats.wellnessadv.com/" : " http://stats.wellnessadv.com/");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
<?php
// LA CONNESSIONE
function conntrue()
{
$my = new mysqli("localhost", "root", "new-password","test");
MySQL [piwik]> explain SELECT
-> log_visit.custom_var_k2 AS `custom_var_k2`,
-> log_visit.custom_var_v2 AS `custom_var_v2`,
-> count(distinct log_visit.idvisitor) AS `1`,
-> count(*) AS `2`,
-> sum(log_visit.visit_total_actions) AS `3`,
-> max(log_visit.visit_total_actions) AS `4`,
-> sum(log_visit.visit_total_time) AS `5`,
-> sum(case log_visit.visit_total_actions when 1 then 1 when 0 then 1 else 0 end) AS `6`,
-> sum(case log_visit.visit_goal_converted when 1 then 1 else 0 end) AS `7`
Important bit of my.cnf
innodb_buffer_pool_size = 5000M
Server is an AMD OPTERON 6128 (2.0 GHz) 8Gb Ram (MySQL is using 70% of them), test was done on nightly our so load is nearly absent.
The from clause is extracted from the query archiving phase
The log_link_visit_action table is ~6,871,070 row and 0.9Gb of data, spanning 3 weeks
(query was executed multiple times (10x), times is the median, first run has been discarded)
PHP Beautifier
Beautify and format your PHP code
Here is your PHP code :
Source
See as Text
@RoyBellingan
RoyBellingan / check.c
Created November 16, 2014 21:57
fbthrift libevent check
#include <sys/types.h>
#include <event.h>
#include <stdio.h>
int main (){
const char* lib_version = event_get_version();
const char* wnt_version = "2.0";
int lib_digits;
int wnt_digits;
@RoyBellingan
RoyBellingan / with
Created February 24, 2015 18:47
with !important
00 00 00 02 17 08 73 74 64 43 6C 61 73 73 14 09 11 09 61 64 76 6E 5F 7A 6F 6E 65 11 0D 77 69 64 74 68 3A 20 36 34 35 70 78 3B 11 0E 61 64 76 6E 5F 63 6F 6E 74 61 69 6E 65 72 11 3D 64 69 73 70 6C 61 79 3A 20 69 6E 6C 69 6E 65 2D 62 6C 6F 63 6B 3B 0A 6D 61 72 67 69 6E 2D 6C 65 66 74 3A 20 36 70 78 3B 0A 76 65 72 74 69 63 61 6C 2D 61 6C 69 67 6E 3A 20 74 6F 70 3B 11 0E 61 64 76 6E 5F 69 6D 61 67 65 5F 62 6F 78 0D 11 0A 61 64 76 6E 5F 69 6D 61 67 65 11 3F 6D 61 78 2D 77 69 64 74 68 3A 20 31 30 30 25 3B 0A 62 6F 72 64 65 72 3A 20 30 70 78 20 6E 6F 6E 65 3B 0A 70 61 64 64 69 6E 67 3A 20 30 25 20 30 25 3B 0A 62 6F 72 64 65 72 2D 72 61 64 69 75 73 3A 20 33 70 78 20 21 69 6D 70 6F 72 74 61 6E 74 3B 0A 62 6F 78 2D 73 68 61 64 6F 77 3A 20 30 20 31 70 78 20 34 70 78 20 72 67 62 61 28 30 2C 20 30 2C 20 30 2C 20 30 2E 32 29 20 21 69 6D 70 6F 72 74 61 6E 74 3B 11 0D 61 64 76 6E 5F 74 65 78 74 5F 62 6F 78 0D 11 0A 61 64 76 6E 5F 74 69 74 6C 65 11 36 66 6F 6E 74 2D 73 74 79 6C 65 3A 20 69 74 61 6C 69 63 3B 0A 66 6F 6E 74 2D 7
@RoyBellingan
RoyBellingan / without
Created February 24, 2015 18:48
without
00 00 00 02 17 08 73 74 64 43 6C 61 73 73 14 09 11 09 61 64 76 6E 5F 7A 6F 6E 65 11 0D 77 69 64 74 68 3A 20 36 34 35 70 78 3B 11 0E 61 64 76 6E 5F 63 6F 6E 74 61 69 6E 65 72 11 3D 64 69 73 70 6C 61 79 3A 20 69 6E 6C 69 6E 65 2D 62 6C 6F 63 6B 3B 0A 6D 61 72 67 69 6E 2D 6C 65 66 74 3A 20 36 70 78 3B 0A 76 65 72 74 69 63 61 6C 2D 61 6C 69 67 6E 3A 20 74 6F 70 3B 11 0E 61 64 76 6E 5F 69 6D 61 67 65 5F 62 6F 78 0D 11 0A 61 64 76 6E 5F 69 6D 61 67 65 11 7B 6D 61 78 2D 77 69 64 74 68 3A 20 31 30 30 25 3B 0A 62 6F 72 64 65 72 3A 20 30 70 78 20 6E 6F 6E 65 3B 0A 70 61 64 64 69 6E 67 3A 20 30 25 20 30 25 3B 0A 62 6F 72 64 65 72 2D 72 61 64 69 75 73 3A 20 33 70 78 3B 0A 62 6F 78 2D 73 68 61 64 6F 77 3A 20 30 20 31 70 78 20 34 70 78 20 72 67 62 61 28 30 2C 20 30 2C 20 30 2C 20 30 2E 32 29 20 21 69 6D 70 6F 72 74 61 6E 74 3B 11 0D 61 64 76 6E 5F 74 65 78 74 5F 62 6F 78 0D 11 0A 61 64 76 6E 5F 74 69 74 6C 65 11 36 66 6F 6E 74 2D 73 74 79 6C 65 3A 20 69 74 61 6C 69 63 3B 0A 66 6F 6E 74 2D 73 69 7A 65 3A 20 31 32 30 25 3B 0
57357 的
23583 他
23185 人
23070 们
22855 你
22270 我
14363 在
14099 是
14025 上
13746 和