Skip to content

Instantly share code, notes, and snippets.

View hkdobrev's full-sized avatar

Harry Dobrev hkdobrev

View GitHub Profile
@hkdobrev
hkdobrev / .gitignore
Last active February 3, 2024 14:37 — forked from octocat/.gitignore
# Folder view configuration files #
###################################
.DS_Store
Desktop.ini
# Thumbnail cache files #
#########################
._*
ehthumbs.db
Thumbs.db
@hkdobrev
hkdobrev / class-order.php
Last active September 7, 2023 09:08
PHP convention for the order in a class.
<?php namespace Vendor\Library;
use Another\Vendor\Library\ClassName;
abstract class ClassName extends AnotherClass implements Countable, Serializable
{
const CONSTANTS = 'top';
use someTrait, anotherTrait {
anotherTrait::traitMethod insteadof someTrait;
@hkdobrev
hkdobrev / git-topics.txt
Created March 27, 2018 19:28
Git topics I'm comfortable discussing
git [add, stach, checkout, reset] --patch
git add --interactive
aliases for fast CLI usage
aliases for advanced functionality
hub https://hub.github.com
git log
git shortlog
git reflog
.mailmap
.gitattributes - export-ignore, better hunk headers, image diffs
@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:

@hkdobrev
hkdobrev / vagrant-ssh.log
Last active December 19, 2015 20:19
Problem with `vagrant ssh` in both `vagrant up` and `vagrant ssh`.
INFO global: Vagrant version: 1.2.3
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.2.3/plugins/communicators/ssh/plugin.rb
INFO manager: Registered plugin: ssh communicator
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.2.3/plugins/provisioners/cfengine/plugin.rb
INFO manager: Registered plugin: CFEngine Provisioner
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.2.3/plugins/provisioners/puppet/plugin.rb
INFO manager: Registered plugin: puppet
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.2.3/plugins/provisioners/shell/plugin.rb
INFO manager: Registered plugin: shell
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.2.3/plugins/provisioners/ansible/plugin.rb
def insertion_sort(list):
for index in range(len(list))
value = list[index]
i = index - 1
while i>=0 and value < list[i]:
list[i+1] = list[i] # shift number in slot i right to slot i+1
list[i] = value #shift value left into slot i
i = i - 1
#!/usr/bin/env bash
echo "Installing Brew..."
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
echo "Installing Brew Cask"
brew install caskroom/cask/brew-cask
echo "Installing VirtualBox"
brew cask install virtualbox
@hkdobrev
hkdobrev / README.md
Created July 24, 2012 09:13
isEqual for objects in JavaScript