Skip to content

Instantly share code, notes, and snippets.

@Ceda
Ceda / Gemfile
Created December 11, 2012 01:11 — forked from baldwindavid/Gemfile
The guts of a page tree using slugs - acts_as_tree, friendly_id - Allows for routes like /about/our-people/developers
gem 'acts_as_tree'
gem "friendly_id", "~> 4.0.1"
Open Terminal.
Type this command:
cd /System/Library/CoreServices/Finder.app/Contents/Resources/English.lproj/
Now, the file we want to mess around is the InfoPlist.strings. But unfortunately, this file cannot be edited directly using text editor in Lion. But no worries. Run this command to make it editable.
sudo plutil -convert xml1 InfoPlist.strings
Now the file should be editable and readable. Use your favorite text editor and open InfoPlist.strings. I just used vim
sudo vim InfoPlist.strings
@Ceda
Ceda / TMBundle LESS
Created October 18, 2013 14:45
Texmate Less TMBundle - Compile to less if in css dir not in subdir
#!/usr/bin/env ruby
dir, base = File.split(File.dirname(ENV["TM_FILEPATH"]))
if (base=="css")
file = STDIN.read[/lessc: ([^*])+\.less/, 1] || ENV["TM_FILEPATH"].chomp(File.extname(ENV["TM_FILEPATH"]))
system("lessc \"#{file}.less\" > \"#{file}.css\"")
end
@Ceda
Ceda / compile-only-if-style.less
Created October 18, 2013 14:55
TMBundle LESS - compile only if filename is style.less
#!/usr/bin/env ruby
filename = File.basename(ENV["TM_FILEPATH"])
if (filename=="style.less")
file = STDIN.read[/lessc: ([^*])+\.less/, 1] || ENV["TM_FILEPATH"].chomp(File.extname(ENV["TM_FILEPATH"]))
system("lessc -x \"#{file}.less\" > \"#{file}.css\"")
end
@Ceda
Ceda / TMBundle complet
Created October 18, 2013 15:31
Less TMBundle - complete, compile less file if exist style.less as style css else like file.less > file.css accept only css dir
#!/usr/bin/env ruby
filename = File.basename(ENV["TM_FILEPATH"])
if (filename=="style.less")
file = STDIN.read[/lessc: ([^*])+\.less/, 1] || ENV["TM_FILEPATH"].chomp(File.extname(ENV["TM_FILEPATH"]))
system("lessc -x \"#{file}.less\" > \"#{file}.css\"")
end
# if is modules path
dir, base = File.split(File.dirname(ENV["TM_FILEPATH"]))
%ul.breadcrumb
%li
%big
="1"
= link_to t('reservations.steps.choose_date_and_count'), root_path
%span.divider
>
%li.active
%big
="2"
@Ceda
Ceda / Greasemonkey cms textarea code highlight.js
Last active August 19, 2020 06:53
Greasemonkey cms textarea code highlight
// ==UserScript==
// @name Blueberry CMS
// @namespace http://blueberry.cz/user/ceda
// @description Highlights the HTML syntax for Textareas in block editor
// @include http://cms.blueberry.cz/*
// @require http://codemirror.net/lib/codemirror.js
// @require http://codemirror.net/addon/fold/foldcode.js
// @require http://codemirror.net/addon/fold/foldgutter.js
// @require http://codemirror.net/addon/fold/xml-fold.js
// @require http://codemirror.net/mode/xml/xml.js
@Ceda
Ceda / zshrc
Created January 24, 2014 17:51
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="steeef"
# Example aliases
@Ceda
Ceda / Folding (Regular Expressions)
Created July 22, 2014 20:16
Folding (Regular Expressions)
{ foldingStartMarker = '(/\*|\{\s*$)|if\s*\(.*\)';
foldingStopMarker = '(\*/|^\s*\})|endif;';
}
@Ceda
Ceda / capybara cheat sheet
Created July 24, 2016 08:45 — forked from iqbalhasnan/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')