Skip to content

Instantly share code, notes, and snippets.

@muriloazevedo
muriloazevedo / wp-shell-install.sh
Created August 24, 2017 18:12 — forked from dongilbert/wp-shell-install.sh
Auto Install Latest WordPress from Shell
#!/bin/bash
# Install script for Latest WordPress by Johnathan Williamson - extended by Don Gilbert
# Disclaimer: It might not bloody work
# Disclaimer 2: I'm not responsible for any screwups ... :)
# DB Variables
echo "MySQL Host:"
read mysqlhost
export mysqlhost
import numpy as np
import argparse
import imutils
import cv2
import sys
cascPath = sys.argv[1]
faceCascade = cv2.CascadeClassifier(cascPath)
# captura a webcam
camera = cv2.VideoCapture(0)
@muriloazevedo
muriloazevedo / update_enconding.sql
Created October 2, 2015 13:58 — forked from anonymous/update_enconding.sql
Atualiza o encoding de latin1 para uft8 do campo "name", na tabela users.
SELECT CONVERT(CONVERT(name USING BINARY) USING latin1) AS latin1,
CONVERT(CONVERT(name USING BINARY) USING utf8) AS utf8
FROM users
WHERE CONVERT(name USING BINARY) RLIKE CONCAT('[', UNHEX('80'), '-', UNHEX('FF'), ']')
@muriloazevedo
muriloazevedo / soap.php
Last active August 29, 2015 14:25
acesso ao magento via soap
<?php
// Magento login information
$mage_url = 'http://MAGENTO/api/soap?wsdl';
$mage_user = 'soap_user';
$mage_api_key = '********';
// Initialize the SOAP client
$soap = new SoapClient( $mage_url );
// Login to Magento
$session_id = $soap->login( $mage_user, $mage_api_key );
@muriloazevedo
muriloazevedo / url.js
Created July 13, 2015 15:34
pega o valor de um parâmetro da querystring via js
function getUrlParameter(sParam)
{
var sPageURL = window.location.search.substring(1);
var sURLVariables = sPageURL.split('&');
for (var i = 0; i < sURLVariables.length; i++)
{
var sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] == sParam)
{
return sParameterName[1];
@muriloazevedo
muriloazevedo / verify_cert.sh
Created May 22, 2015 12:28 — forked from anonymous/verify_cert.sh
verify ssl certificate for domain
echo | openssl s_client -connect google.com:443 2>/dev/null | openssl x509 -noout -dates
#!/bin/bash
# use imagemagick to merge all images in a folder to produce a spritesheet
# use conver -append for vertical stacking and
# convert +append for horizontal
if [ $# -gt 0 ]
then
if [ $2 ]
# downgrade to php5.4 first
sudo apt-get install software-properties-common python-software-properties
sudo add-apt-repository ppa:ondrej/php5-oldstable -y
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install php5
# install ajenti
wget -O- https://raw.github.com/Eugeny/ajenti/master/scripts/install-ubuntu.sh | sudo sh
@muriloazevedo
muriloazevedo / gist:b8faf94dc92a0dae34b1
Created September 26, 2014 23:54
Exemplo de array_chunk
<div class="carousel-inner">
<div class="item">
<?php
$input_array = array('a', 'b', 'c', 'd', 'e');
$carousel = array_chunk($input_array, 2);
foreach($carousel as $c):
?>
<div class="row">
<?php foreach($c as $item):?>
<div class="col-md-3"></div>
@muriloazevedo
muriloazevedo / gist:e4a5d5576f109c625cbb
Created September 13, 2014 23:28 — forked from farandal/gist:5923317
Config for nginx work with thumbs
#Attention!, this scripts needs a modified version of timthumb you'll find in my git account.
#Francisco Aranda, Developer, Software Architect and Enterpreneur, Chile.
#http://farandal.com
#http://www.git.com/farandal
location ~ /thumb/.*\.(png|jpg)$ {
#set $domain yourdomain.com; # Change this to your site's domain name, you may or not need to uncomment this.
set $root_fcgi /home/user/public_html/yourdomain.com/public; # Change this to the public root folder of your site
set $root_cache $root_fcgi/thumb; # Change this to a folder in which to cache the minified files