Skip to content

Instantly share code, notes, and snippets.

View kaning's full-sized avatar
💭
Trying to Focus

Kwabena Aning kaning

💭
Trying to Focus
View GitHub Profile
@kaning
kaning / gist:4708318
Created February 4, 2013 17:55
.htaccess file to route request to another folder from the root directory already configured in vhosts
RewriteEngine On
RewriteRule ^\.htaccess$ - [F]
RewriteCond %{REQUEST_URI} =""
RewriteRule ^.*$ /public/index.php [NC,L]
RewriteCond %{REQUEST_URI} !^/public/.*$
RewriteRule ^(.*)$ /public/$1

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
class ClassifiedForm(ModelForm):
class Meta:
model = Classified
fields = ['title', 'description', 'contact']
def __init__(self, *args, **kwargs):
super(ClassifiedForm, self).__init__(*args, **kwargs)
self.helper = FormHelper()
self.helper.form_class = 'form-horizontal'
self.helper.form_method = 'post'
val getUserById =
(apiOperation[User]("getUserById")
summary "Get a user by a given ID"
parameters pathParam[Int]("id").description("The id for the user to be retrieved"))
get("/:id", operation(getUserById)) {
val userID = params.getAs[Int]("id").getOrElse(halt(400))
val userData = Users.findUserByID(userID)
userData match {
git branch --merged | grep -v "\*" | xargs -n 1 git branch -d

Keybase proof

I hereby claim:

  • I am kaning on github.
  • I am kaning (https://keybase.io/kaning) on keybase.
  • I have a public key ASBE8EQlbYAra49ctCtVSe12ulEaIySbYbRpNrlo6TJm2wo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am kaning on github.
  • I am kaningels (https://keybase.io/kaningels) on keybase.
  • I have a public key ASChxHKCypLNR4--OM4pyTkxSNr4PDauq4qz85W2f8qC-go

To claim this, I am signing this object:

\<CR>---
\<CR>title:
\<CR>date: =strftime('%c')
\<CR>draft: true
\<CR>author: "Kwabena Aning"
\<CR>tags: []
\<CR>---