December 2011
1 post
3 tags
RSpec Rails be_a_new matcher
Passes if the object is a Widget and returns true for new_record?:
object.should be_a_new(Widget)
March 2011
1 post
1 tag
Reset Heroku Database and Reload Seeds
Since heroku rake db:migrate:reset doesn’t work you should run:
heroku pg:reset SHARED_DATABASE --confirm <APP_NAME>
heroku rake db:migrate
April 2010
2 posts
3 tags
3 tags
February 2010
2 posts
3 tags
Variable argument lists in Cocoa →
4 tags
Cocoa Application Startup →
December 2009
3 posts
4 tags
rake console: a custom irb instance for your ruby... →
2 tags
We could not complete your iTunes Store request.... →
2 tags
How to Unpack a Debian Source Package →
November 2009
1 post
2 tags
Versioning HTTP APIs →
August 2009
1 post
2 tags
Visor for OSX →
a system-wide terminal accessible via a hot-key
June 2009
1 post
2 tags
Terminal.app Tab Namer v0.1 Alpha →
is a SIMBL plugin for Terminal.app on Leopard that lets you name your tabs.
April 2009
1 post
3 tags
irb readline support on Leopard →
March 2009
1 post
1 tag
Feedzirra →
is a new ruby feed library “built for speed”.
January 2009
3 posts
3 tags
Location of the MySQL Socket File in Different...
From #mysql_socket_location:
"/tmp/mysql.sock", # default
"/var/run/mysqld/mysqld.sock", # debian/gentoo
"/var/tmp/mysql.sock", # freebsd
"/var/lib/mysql/mysql.sock", # fedora
"/opt/local/lib/mysql/mysql.sock", # fedora
"/opt/local/var/run/mysqld/mysqld.sock", # mac + darwinports + mysql
"/opt/local/var/run/mysql4/mysqld.sock", # mac + darwinports + mysql4
"/opt/local/var/run/mysql5/mysqld.sock",...
4 tags
Install MySQL and mysql gem on Mac OS X Leopard
Install MySQL server via MacPorts:
sudo port install mysql5 +server
Setup the database:
sudo -u mysql mysql_install_db5
Configure MySQL to start up automatically when OS X boots:
sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist
Install mysql gem:
sudo gem install mysql -- --with-mysql-config=/opt/local/bin/mysql_config5
Source.
Socket location:...
4 tags
Adding Bash Completion for Git on Mac OS X Snow...
Copy this code and paste it into Terminal.
This also should work for any *NIX.
Update
There are the easiest ways to add bash completion for git.
For Mac OS X
Install git via MacPorts:
sudo port install git-core +bash_completion
Then add the following lines at the end of your ~/.profile:
if [ -f /opt/local/etc/bash_completion ]; then
. /opt/local/etc/bash_completion
fi
For...
December 2008
1 post
Post for visitors from barushev.net
New admins form Netlux ISP have deleted my old site barushev.net. I have no backups but I’m not upset because old site was so outdated. This blog is my primary homepage now.
Welcome.
November 2008
1 post
1 tag
Passing All Arguments from One JavaScript Function...
Function.prototype.apply should do the job:
function debug() {
if (settings.debug) {
console.log.apply(this, arguments);
}
}
October 2008
4 posts
Lessons Learned while Building an iPhone Site →
3 tags
Firebug Console Object and API →
Firebug adds a global variable named “console” to all web pages loaded in Firefox. This object contains many methods that allow you to write to the Firebug console to expose information that is flowing through your scripts.
2 tags
Calling preventDefault during any stage of event flow cancels the event, meaning...
– Gecko DOM Reference
2 tags
If child is a reference to an existing node in the document, appendChild moves...
– Gecko DOM Reference
September 2008
5 posts
2 tags
A Simple jQuery Plugin Skeleton
(function ($) {
$.fn.pluginName = function (settings) {
settings = $.extend({
param: 'value'
}, settings);
return this.each(
function () {
var $this = $(this);
// plugin code here
}
);
};
})(jQuery);
http://gist.github.com/12656
2 tags
CSS min-height Fast Hack
This hack which is a pure CSS solution will get a min-height working for IE6. MSIE 7.0 supports CSS min-height.
selector {
min-height: 500px;
height: auto !important;
height: 500px;
}
Min-Height Fast Hack
3 tags
Using Kompare for Git Diffs
It’s possible to use kompare as a graphical diff viewer for git. I created file git-kompare in my /usr/local/bin/ directory with such content:
git diff $* | kompare -
I also created alias gk for this command in my ~.bashrc:
alias gk='git-kompare'
Now I can use gk command instead of git diff with all its options.
1 tag
Bash Script That Deletes Itself
suicide.sh
#!/bin/rm
1 tag
Truncating a File to Zero Bytes
> log/development.log
August 2008
1 post
2 tags
Removing a Remote git Branch
git push origin :branch_name
November 2007
1 post
January 2007
1 post
Hi
My name is Denis. I’m a web developer from Donetsk, Ukraine. This is my tlog.