Skip to content

Instantly share code, notes, and snippets.

View samir's full-sized avatar
:octocat:
I may be slow to respond.

Samir M. Braga samir

:octocat:
I may be slow to respond.
View GitHub Profile
@samir
samir / ramos_de_atividade.txt
Created October 7, 2020 19:49 — forked from prodis/ramos_de_atividade.txt
Lista de ramos de atividade
Alimentos e Bebidas
Arte e Antiguidades
Artigos Religiosos
Assinaturas e Revistas
Automóveis e Veículos
Bebês e Cia
Blu-Ray
Brindes / Materiais Promocionais
Brinquedos e Games
Casa e Decoração
@samir
samir / README.md
Last active August 26, 2020 00:56
Setup Tailwind with Vue.js

Keybase proof

I hereby claim:

  • I am samir on github.
  • I am samirbraga (https://keybase.io/samirbraga) on keybase.
  • I have a public key ASABzoxpWPW2ysmE2rf8--mmFKjWSxtyQcUCrFXMPh_JhAo

To claim this, I am signing this object:

@samir
samir / date_time.rb
Created September 1, 2014 20:33
Get next and previous business day
module BusinessDay
def next_business_day
self.skip_weekends self, 1
end
def previous_business_day
self.skip_weekends self, -1
end
protected
def skip_weekends(date, inc)
date += inc
@samir
samir / gist:4178992
Created November 30, 2012 21:59
Create Schema Database with charset and collate in MySQL
CREATE DATABASE dbname CHARACTER SET utf8 COLLATE utf8_general_ci;
@samir
samir / clean-infected-files.sh
Created May 31, 2012 02:59
Clean infected php files with eval(base64_decode()) functions - usually in wordpress
#!/bin/bash
find . -name "*.php" -type f -exec sed -i 's/<?php \/\*\*\/ eval(base64_decode(\"[a-z0-9A-Z\/\+]*\"));?>//g' {} \;
# or
find . -name "*.php" -type f -exec sed -i 's/<?php \/\*\*\/ eval(base64_decode(\"[^"]*\"));?>//g' {} \;
@samir
samir / email_steps.rb
Created March 6, 2012 14:41
Usefull cucumber steps in portuguese
# -*- encoding : utf-8 -*-
# Commonly used email steps
#
# To add your own steps make a custom_email_steps.rb
# The provided methods are:
#
# last_email_address
# reset_mailer
# open_last_email
# visit_in_email
@samir
samir / deploy.rb
Created March 6, 2012 14:35
Unicorn Capistrano Recipe
# Unicorn tasks
namespace :unicorn do
def pid_path
"#{shared_path}/pids/unicorn.pid"
end
def socket_path
"#{shared_path}/sockets/unicorn.sock"
end
@samir
samir / gist:1148289
Created August 16, 2011 02:00
Edição multiplas linhas sem estar na mesma coluna
<th><%= link_to "Name</th>
<th><%= link_to "First</th>
<th><%= link_to "Last and pum</th>
Selecionar de Name (sem a aspa inicial) até antes do Last (inclusive a aspa inicial)
Digitar Command + Option + a
O cursor irá par ao final da primeira linha da seleção,
@samir
samir / php.ini
Created January 8, 2011 17:08
XDebug php.ini config
zend_extension="/usr/local/Cellar/xdebug/2.1.0/xdebug.so"
[xdebug]
;xdebug.max_nesting_level=10
xdebug.collect_params=3
xdebug.show_local_vars=5
xdebug.dump.GET=*
xdebug.dump.POST=*
xdebug.default_enable = On