Skip to content

Instantly share code, notes, and snippets.

View eduzera's full-sized avatar
😀

Eduardo Zaghi eduzera

😀
View GitHub Profile
@eduzera
eduzera / .htaccess
Created August 27, 2018 21:57
redirect site to subfolder
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_URI} !^/blog/
# Rewrites all URLS [Replace "example" with the actual domain, without the TLD (.com, .net, .biz, etc)]
RewriteCond %{HTTP_HOST} ^(www\.)?example\.
# Rewrite all those to insert /folder
RewriteRule ^(.*)$ /blog/$1 [L]
@eduzera
eduzera / process.md
Created August 9, 2018 01:47
mercado livre products edit

mercado livre products edit

on js console

urlBase = "https://vender.mercadolivre.com.br/item/update?itemId=MLB"

$('.itemId').each(function(item){ console.log(urlBase+$(this).text().replace('#', '')) })
@eduzera
eduzera / update-wordpress.md
Last active December 18, 2017 16:01
update wordpress address

1. Signin wordpress server

ssh [user]@[server_address]

2. Access mysql console

mysql -u [user] -D [database] -p
@eduzera
eduzera / generator-gulp-angular-errors.md
Last active December 28, 2016 17:31
fixing generator-gulp-angular errors

Install

generator-gulp-angular at https://github.com/Swiip/generator-gulp-angular

Fixing Bootstrap Sass

#index.scss
@eduzera
eduzera / readme.md
Last active November 4, 2016 11:07
apache2 service with 100%

Check the most ips online

netstat -tan| grep -v 'LISTEN'| awk '{print $5}'| grep -v 'and' |grep -v 'Address' |cut -d':' -f1 |sort -n | uniq -c | sort -rn | head -n10

Check the most 10 ips access the server

cd /var/log/apache2; for i in ./access.log; do echo $i; cat $i | awk '{print $1}'| sort -n | uniq -c | sort -rn | head -n10; done
@eduzera
eduzera / 01-example.sh
Created October 12, 2016 12:43
parse geotype
curl -X GET \
-H "X-Parse-Application-Id: parseloldesign" \
-G \
--data-urlencode 'limit=10' \
--data-urlencode 'where={
"project": "fitfoodtime",
"location": {
"$nearSphere": {
"__type": "GeoPoint",
"latitude": -23.563087,
@eduzera
eduzera / facebbok_user_service.js
Last active September 29, 2016 16:24
ionic facebook example
(function() {
'use strict';
angular
.module('app.restaurants')
.service('UserService', userService);
userService.$inject = ['$http', '$q', '$auth', '$cordovaGeolocation', 'localStorageService', '$log'];
/* @ngInject */
@eduzera
eduzera / car.rb
Created July 14, 2016 14:25
require relative example
class Car
attr_accessor :name, :brand
def initialize(options={})
@name = options[:name]
@brand = options[:brand]
end
def somebody_inside?
@people_inside.present?

Heroku execute script file .sql

psql -h HOST -p PORT -d DATABASE -U USER -f FILENAME