Skip to content

Instantly share code, notes, and snippets.

@hackaugusto
hackaugusto / qt.cpp
Created January 3, 2012 15:42
qt vs. windows
#include <QtGui/QApplication>
#include "qmlapplicationviewer.h"
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QmlApplicationViewer viewer;
viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
viewer.setMainQmlFile(QLatin1String("qml/qml/clocks.qml"));
@hackaugusto
hackaugusto / gist:2064711
Created March 17, 2012 19:44
django gzip middleware with streaming support
Index: gzip.py
===================================================================
--- gzip.py (revision 17761)
+++ gzip.py (working copy)
@@ -1,4 +1,5 @@
import re
+from zlib import compressobj
from django.utils.text import compress_string
from django.utils.cache import patch_vary_headers
@hackaugusto
hackaugusto / gist:2332714
Created April 7, 2012 23:02
beautiful, dont you think?
package recovery;
import java.util.ArrayList;
import javax.swing.JOptionPane;
public class Main {
public static Janela janela;
static ArrayList<Transacao> transacoes = new ArrayList();
#include "stdafx.h"
#pragma comment(lib, "Ws2_32.lib")
using namespace std;
class Bluetooth {
public:
Bluetooth(const wchar_t* service_name, const GUID* guid);
Bluetooth(const wchar_t* service_name, const GUID* guid, const wchar_t* description);
<?php
public function SMsDoBancoCarregar(){
//retorna os dados
$dados = $this->mensagemBD->SmsDadosRetornar($this->idMensagem);
//cria os sms
for($i=0;$i<count($dados);$i++){
@hackaugusto
hackaugusto / PKGBUILD
Created June 29, 2012 14:33
PKGBUILD for depot_tools
pkgname=depot_tools-svn
pkgver=144877
pkgrel=1
pkgdesc="Build tools, includes gclient"
arch=('any')
url="http://dev.chromium.org/developers/how-tos/install-depot-tools"
license=('Custom')
depends=('python2' 'python2-colorama')
makedepends=('subversion' 'scons' 'setconf')
provides=('depot' 'depot_tools' 'gclient')
@hackaugusto
hackaugusto / PKGBUILD
Created June 29, 2012 15:49
PKGBUILD for spdy
pkgname=mod_spdy
pkgver=trunk
pkgrel=4
pkgdesc="SPDY module for Apache 2.2 that allows your web server to take advantage of SPDY features like stream multiplexing and header compression."
arch=('i686' 'x86_64')
url="http://code.google.com/p/mod-spdy/"
license=('APACHE')
makedepends=('svn' 'curl' 'depot_tools-svn' 'python2')
depends=('apache' 'depot_tools-svn')
<?php
$arr = array();
foreach( $tr_list as $count => $tr ){
$td_list = $xpath->query('//td',$tr);
$new = array();
foreach( $td_list as $i => $data ){
$i_ = $i % count($fields);
$new[$fields[$i_]] = $data->textContent;
.tabbar {
background: #b6b6b6;
height: 30px;
}
.row-fluid .span2-tab {
margin-left: 0px;
width: 17.02127659574468%;
background: #b6b6b6;
}
.row-fluid .span2-tab:first-child {
@hackaugusto
hackaugusto / apacheerr.sh
Created November 30, 2012 14:21
cacti - data query
#!/bin/sh
sed -e "s/\[.*\]\([^:]*\)\(.*\)/\1/" /var/log/httpd/error_log |
sort |
uniq -c |
tr -s " " |
sed 's/^[ ]//g' |
cut -f 1 -d ' ' |
awk '{a+=$0}END{print a}'