Skip to content

Instantly share code, notes, and snippets.

View devdrops's full-sized avatar
🔥
Paz Entre Nós, Guerra Aos Senhores

Davi Marcondes Moreira devdrops

🔥
Paz Entre Nós, Guerra Aos Senhores
View GitHub Profile
@samsonasik
samsonasik / gist:3988701
Created October 31, 2012 17:57
Send HTML Mail Using ZF2
use Zend\Mail\Message;
use Zend\Mail\Transport\Smtp as SmtpTransport;
use Zend\Mime\Message as MimeMessage;
use Zend\Mime\Part as MimePart;
use Zend\Mail\Transport\SmtpOptions;
//////////
$message = new Message();
@samsonasik
samsonasik / gist:4171219
Created November 29, 2012 19:20
set #zf2 in shared hosting ( .htaccess )
RewriteCond %{HTTP_HOST} ^yourdomain.com$ [NC,OR]
RewriteCond %{REQUEST_URI} !yourapp/public
RewriteRule (.*) /yourapp/public/$1 [L]
place it at your public_html (shared hosting 'root' directory ).
if you call http://yourdomain.com so you will point out to public_html/yourapp/public/index.php
@alganet
alganet / RESTinPaaS.md
Created December 17, 2012 09:32
Um ensaio sobre REST e computação na nuvem.

REST in PaaS

Computação em Nuvem

O termo computação em nuvem ficou difícil de definir nos últimos anos. Não dá pra explicar o que ele é sem decorar um monte de letrinhas e conceitos. Decorar as letrinhas é legal, mas saber um pouco da história por trás delas é mais legal ainda. Prometo ser breve!

Virtualização

Tudo começou com virtualização. Se você não conhece o termo, vou dar uma boa definição que serve pra enrolar alguém numa conversa de bar: Com virtualização você pode rodar várias máquinas virtuais menores em uma única máquina real.

@Osse
Osse / vdwrap
Last active October 18, 2022 18:06
Vimdiff wrapper for use with git difftool --dir-diff
#!/usr/bin/env zsh
# Configuration:
# $ git config --global diff.tool vdwrap
# If you don't put vdwrap somewhere in $PATH then either:
# $ git config --global difftool.vdwrap.cmd '/full/path/vdwrap $LOCAL $REMOTE'
# or:
# $ git config --global difftool.vdwrap.cmd 'vdwrap $LOCAL $REMOTE'
# $ git config --global difftool.vdwrap.path '/full/path'
#
@hovsater
hovsater / gist:5068370
Last active October 21, 2021 08:58
Removing non-empty local directories with netrw

A few months ago I read Drew Neil's article about split windows and the project drawer. It's a great article and I strongly recommend you to go ahead and read it.

The article got me spending some time with netrw and sure enough, it replaced NERDTree. One thing that annoyed me though, was its default for deleting directories. Quoting from :help netrw-delete.

Deleting/removing files and directories involves moving the cursor to the file/directory to be deleted and pressing "D". Directories must be empty first before they can be successfully removed.

This is not a default I'm happy with, but as with everything else in Vim, netrw is customisable. The default command for deleting local directories is rmdir which requires the directory to be empty. By setting `g:netrw_localrmdir

@mislav
mislav / _readme.md
Last active June 21, 2026 22:49
tmux-vim integration to transparently switch between tmux panes and vim split windows

I use tmux splits (panes). Inside one of these panes there's a Vim process, and it has its own splits (windows).

In Vim I have key bindings C-h/j/k/l set to switch windows in the given direction. (Vim default mappings for windows switching are the same, but prefixed with C-W.) I'd like to use the same keystrokes for switching tmux panes.

An extra goal that I've solved with a dirty hack is to toggle between last active panes with C-\.

Here's how it should work:

@mattn
mattn / upload.go
Last active August 3, 2021 05:26
package main
import (
"crypto/sha1"
"fmt"
"io"
"mime/multipart"
"net/http"
"os"
"path/filepath"
@yosymfony
yosymfony / index.php
Last active December 19, 2015 09:49
Simple skeleton for Silex application
<?php
require_once __dir__.'/vendor/autoload.php';
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
/**
* Simple skeleton for Silex
*
* Run in PHP >=5.4: $ php -S localhost:8080 -t web web/index.php
@Starefossen
Starefossen / tmux-cheats.md
Last active June 17, 2026 17:02
My personal tmux cheat sheet for working with sessions, windows, and panes. `NB` I have remapped the command prefix to `ctrl` + `a`.

Sessions

New Session

  • tmux new [-s name] [cmd] (:new) - new session

Switch Session

  • tmux ls (:ls) - list sessions
  • tmux switch [-t name] (:switch) - switches to an existing session
@Starefossen
Starefossen / vim-cheats.md
Last active June 16, 2026 10:33
My vim cheat sheet for working with tabs and window splits.

Tabs

New Tab

  • :tabnew - new blank tab
  • :tabedit [file] - open file in tab

Cursor Movement

  • gt (:tabn) - next tab