Skip to content

Instantly share code, notes, and snippets.

View mdyn's full-sized avatar

Maxim Dyn mdyn

  • Cogniance
  • Kiev
View GitHub Profile
@mdyn
mdyn / replace.sh
Created November 7, 2012 15:08
Replace old to new
#!/bin/bash
DIRW=$1
echo "path $DIRW"
find $DIRW -type f -exec sed -i 's/<departDate>/<startDate>/g' {} \;
find $DIRW -type f -exec sed -i 's/<arriveDate>/<endDate>/g' {} \;
find $DIRW -type f -exec sed -i 's/<departTime>/<startTime>/g' {} \;
find $DIRW -type f -exec sed -i 's/<arriveTime>/<endTime>/g' {} \;
find $DIRW -type f -exec sed -i 's/<departAirport>/<startCode>/g' {} \;
@mdyn
mdyn / gist:4232463
Created December 7, 2012 10:51
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

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
<?php
switch( preg_last_error() ){
case PREG_NO_ERROR :
$preg_error = 'No error';
break;
case PREG_INTERNAL_ERROR :
$preg_error = 'An internal PCRE error';
break;
case PREG_BACKTRACK_LIMIT_ERROR :
$preg_error = 'Backtrack limit was exhausted';

Sublime Text 2 – Useful Shortcuts (PC)

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

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
@mdyn
mdyn / .vimrc
Created February 13, 2013 09:59
My .vimrc
set nocompatible
set noruler
call pathogen#infect()
set noshowcmd
set number
set incsearch
set hlsearch
set ignorecase
set smartcase
set scrolljump=7
@mdyn
mdyn / homework_01.rb
Created February 20, 2013 10:52
Ruby Academy Homework 01: rubeque, elementary level
# Solution to 'The Truth' on rubeque.com
# by mdyn
# http://rubeque.com/problems/the-truth
assert_equal true, true
# Solution to 'Reverse' on rubeque.com
# by mdyn
# http://rubeque.com/problems/reverse