Skip to content

Instantly share code, notes, and snippets.

View tiagocardosos's full-sized avatar
🏠
Working from home

Tiago Cardoso tiagocardosos

🏠
Working from home
View GitHub Profile
@tiagocardosos
tiagocardosos / gist:3921672
Created October 20, 2012 01:56 — forked from davialexandre/gist:3921652
Exemplo de customização de filtros no CGridView
<?php $this->widget('zii.widgets.grid.CGridView', array(
'columns'=>array(
array(
'name' => 'pesquisa',
'value' => '$data->pesquisa',
'header' => 'Termo',
),
array(
'name' => 'data_cadastro',
'value' => 'Yii::app()->dateFormatter->formatDatetime(strtotime($data->data_cadastro), "short", "short")',
cd /tmp
pecl download memcache
tar xzf memcache-2.2.6.tar
cd memcache-2.2.6
phpize
MACOSX_DEPLOYMENT_TARGET=10.7 CFLAGS='-O3 -fno-common -arch i386 -arch x86_64' LDFLAGS='-O3 -arch i386 -arch x86_64' CXXFLAGS='-O3 -fno-common -arch i386 -arch x86_64' ./configure --with-php-config=php-config
make
sudo make install

Command Line Tools for Xcode

Command line tools comes bundle with Xcode prior to 4.3 version. After 4.3, you need to install a separated command line tools yourself.

First, go to this url and login using Apple Developer account (Free to register)

https://developer.apple.com/downloads/index.action
@tiagocardosos
tiagocardosos / App.vue
Last active June 26, 2017 12:40
Utilizar multiplos templates em 1 component
<template>
<div>
<spinner global text="Aguarde..."></spinner>
<div id="wrapper" v-if="isAuth" class="fixed-nav skin-1" :class="{ 'mini-navbar': isOpen }">
<preloader-component></preloader-component>
<nav-component></nav-component>
<div id="page-wrapper" class="gray-bg">
<nav-top-component @toogle="onToogleMenu"></nav-top-component>
<header-title-component></header-title-component>
<div class="wrapper wrapper-content animated fadeInRight">
@tiagocardosos
tiagocardosos / estados.php
Last active August 3, 2017 12:19
Array estados brasileiros
<?php
$estados = [
'AC'=>'Acre',
'AL'=>'Alagoas',
'AP'=>'Amapá',
'AM'=>'Amazonas',
'BA'=>'Bahia',
'CE'=>'Ceará',
'DF'=>'Distrito Federal',
'ES'=>'Espírito Santo',
@tiagocardosos
tiagocardosos / LC_CTYPE.txt
Created October 18, 2017 09:02 — forked from thanksdanny/LC_CTYPE.txt
Centos warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
vi /etc/environment
add these lines...
LANG=en_US.utf-8
LC_ALL=en_US.utf-8
@tiagocardosos
tiagocardosos / clear_binary_log_mysql.txt
Last active March 5, 2024 12:18
MySQL Clear Binary Log
Can I Remove MySQL Binary Log Yes, as long as the data is replicated to Slave server, it’s safe to remove the file. It’s recommend only remove MySQL Binary Log older than 1 month.
Besides, if Recovery of data is the main concern, it’s recommend to archive MySQL Binary Log.
There are several ways to remove or clean up MySQL Binary Log, it’s not recommend to clean up the file manually, manually means running the remove command.
Remove MySQL Binary Log with RESET MASTER Statement Reset Master statement is uses for new database start up during replication for Master and Slave server. This statement can be used to remove all Binary Log.
To clean up Binary Log on Master Server
@tiagocardosos
tiagocardosos / python_firebird
Created October 19, 2017 17:01
Python & Firebird
# Importando o Driver de conexao do Firebird
import fdb
import os.path
# Conecta ao Firebird
con = fdb.connect(dsn='X.X.X.X:/Caminho/Base.GDB', user='user', password='senha')
# Executando SQL
cursor = con.cursor() # cria cursor
@tiagocardosos
tiagocardosos / python_ubuntu_docker.sh
Last active June 21, 2022 11:09
How to Install Python 3.6.* in Ubuntu 16.04 LTS - Docker
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:jonathonf/python-3.6
sudo apt-get update
sudo apt-get install python3.6 libpython3.6
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.5 2
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 1
sudo rm /usr/bin/python3
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import httplib
import re
import sys
import base64
import subprocess
import urllib
import lxml.etree