Skip to content

Instantly share code, notes, and snippets.

View hkdobrev's full-sized avatar

Harry Dobrev hkdobrev

View GitHub Profile
@chardcastle
chardcastle / Kohana cron.php
Created May 17, 2010 22:44
My cron file for kohana 2.3.4
<?php
/**
* Created by Chris Hardcastle to run cron jobs
* Based on the default kohana 2.3.4 index.php
* Note the required #! stated above
* CRON TAB USAGE (To run twice a day)
0 0,12 * * * /usr/bin/php [root][site]/cron.php --controller --method
*
* Use the shebang --> #!/usr/bin/php (should you need it, thanks @spolster)
*/
@hkdobrev
hkdobrev / error.php
Created January 11, 2012 23:42
Custom Kohana_Exception class for handling exceptions in production.
<?php defined('SYSPATH') OR die('No direct access allowed!');
class Controller_Error extends Controller_Layout {
public function before()
{
parent::before();
$this->response->status((int) $this->request->action());
@skwp
skwp / vertical_splits.vim
Created March 13, 2012 19:34
vim navigate to vertical splits
" use ,F to jump to tag in a vertical split
nnoremap <silent> ,F :let word=expand("<cword>")<CR>:vsp<CR>:wincmd w<cr>:exec("tag ". word)<cr>
" use ,gf to go to file in a vertical split
nnoremap <silent> ,gf :vertical botright wincmd f<CR>
" see more at http://skwp.github.com/dotfiles
@hkdobrev
hkdobrev / gist:2031902
Created March 13, 2012 21:42
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Selecting / Jumping

Ctrl+L select line (repeat to select next lines)
Ctrl+D select word (repeat select others occurrences in context for multiple editing)
@hkdobrev
hkdobrev / gist:2049057
Created March 16, 2012 08:04 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@cowboy
cowboy / abstraction-lite.js
Created August 31, 2012 20:57
Abstraction.js "Lite" (live-coded at BrazilJS 2012)
/*
* Abstraction.js "Lite"
*
* Copyright (c) 2012 "Cowboy" Ben Alman
* Licensed under the MIT license.
* http://benalman.com/about/license/
*/
var $elseif, $else;
var $if = function(state) {
@ngauthier
ngauthier / tips.md
Created July 24, 2014 14:32
Nick's Trello Tips
  1. Only keep the members who need to do something (blocking) the card on the card. Not everyone involved. After you do your part, take yourself off the card, and possibly add someone else to the card if it's their turn. It's important that all the cards with your face on it need you to do something. No false-positives.
  2. If you need someone's opinion on a card but they don't have to do something, just mention in a comment
  3. The description is the current state of the task, not a history of the evolution of the task. Comments are a history of the discussion that yields the description
  4. Use labels to indicate the kind of card, not state (e.g. "bug" but not "in qa"). Alternatively, have a code system in the card title. For example, we process data in batches. Batches have one to two letters to indicate client and numbers that increment. So IS42 is Internal Sales batch #42. This is nice when the label needs to be a little different each time. Instead of a label, put it at the beginning of the title.
  5. Use
@cowboy
cowboy / Abstraction.js
Created May 24, 2012 20:25
A modern JavaScript if-elseif-else abstraction, because control flow statements are so 1995
/*
* Abstraction.js
*
* Copyright (c) 2012 "Cowboy" Ben Alman
* Licensed under the MIT license.
* http://benalman.com/about/license/
*/
var Abstraction = (function($) {
var _ = $.prototype;
@hkdobrev
hkdobrev / README.md
Created September 16, 2012 20:32
SASS mixin for responsive grids

Responsive grids in SASS

Ever wanted to generate @media rules for your grid?

Ever used a calculator or an Excel spreadsheet to calculate widths for every column?

No more!

Usage:

@johnwards
johnwards / MessageLogger.php
Created August 1, 2011 11:14
Testing Swiftmailer in a Silex app
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/