Skip to content

Instantly share code, notes, and snippets.

View LeZuse's full-sized avatar
🚀
Scaling productboard.com

Tomas Ruzicka LeZuse

🚀
Scaling productboard.com
View GitHub Profile
@henrik
henrik / .bashrc
Created December 3, 2008 17:56
Git branch and dirty state in Bash prompt.
# http://henrik.nyh.se/2008/12/git-dirty-prompt
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/
# username@Machine ~/dev/dir[master]$ # clean working directory
# username@Machine ~/dev/dir[master*]$ # dirty working directory
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/"
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
BLUE="\[\033[0;34m\]"
LIGHT_RED="\[\033[1;31m\]"
LIGHT_GREEN="\[\033[1;32m\]"
WHITE="\[\033[1;37m\]"
LIGHT_GRAY="\[\033[0;37m\]"
COLOR_NONE="\[\e[0m\]"
def ajaxsubmit(request):
new_msg = Message(msg = request.POST['msg'],
posted_by = request.POST['posted_by'])
new_msg.save()
# Again, we're just going to assume this always works
cmd = [{'cmd': 'inlinepush',
'params': {
'password': settings.APE_PASSWORD,
'raw': 'postmsg',
'channel': 'messages',
@groupdock
groupdock / ejabberd_
Created June 16, 2010 13:15
ejabberd munin plugin
#!/bin/bash
#
# Updated/Modified by Luc Castera (2010-06-14). Intellum Inc.
# (http://www.intellum.com)
#
# Munin plugin for ejabberd2.
#
# Written by Lasse Karstensen <lkarsten@hyse.org> 2007-05-27.
# Based on ejabberd-plugin by Christian Dröge <Christian@draugr.de>
#
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Viktor Stískala
# Contact: viktor (at) stiskala.cz
# Copyright: This module has been placed in the public domain.
"""
This module removes language specific characters from file name
and makes it more usable for web. Can be also used as nautilus user script
@mnutt
mnutt / Instrument Anything in Rails 3.md
Created September 6, 2010 06:50
How to use Rails 3.0's new notification system to inject custom log events

Instrument Anything in Rails 3

With Rails 3.0 released a few weeks ago I've migrated a few apps and I'm constantly finding useful new improvements. One such improvement is the ability to log anything in the same way that Rails internally logs ActiveRecord and ActionView. By default Rails 3 logs look slightly spiffier than those produced by Rails 2.3: (notice the second line has been cleaned up)

Started GET "/" for 127.0.0.1 at Mon Sep 06 01:07:11 -0400 2010
  Processing by HomeController#index as HTML
  User Load (0.2ms)  SELECT `users`.* FROM `users` WHERE (`users`.`id` = 3) LIMIT 1
  CACHE (0.0ms)  SELECT `users`.* FROM `users` WHERE (`users`.`id` = 3) LIMIT 1

Rendered layouts/_nav.html.erb (363.4ms)

@janmarek
janmarek / gist:572165
Created September 9, 2010 16:55
Gridito template macros
{gridito usersGrid}
{* top toolbar *}
{gridito.toolbar.button addUser text => "Nový uživatel", icon => "plusthick", plink => "add"}
{* columns *}
{gridito.column username text => "Uživatelské jméno", sortable => true}
{gridito.column name text => "Jméno", sortable => true}
{gridito.column mail text => "E-mail", sortable => true}
{gridito.column allowed text => "Aktivní", sortable => true}
{gridito.column created text => "Datum založení", sortable => true, dateTimeFormat => "j.n.Y"}

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.

Variables

@weakish
weakish / ZTD-habits.markdown
Created January 21, 2011 06:42
Outlines of Zen To Done. #gtd

Outlines of Zen To Done.

The 10 Habits of ZTD

  1. ubiquitous capture: take notes with a small notebook, a small stack of index cards, or a mobile phone, and empty them into your todo list when go back.
###*
Copyright (c) 2011 daniel.steigerwald.cz MIT-style license
###
###*
@fileoverview Bootstrap for the Steida JS Library
todo:
add warning about obsolete browsers
###