Public Gists by seouri

Gravatar
Fri May 01 06:09:52 -0700 2009
1
SELECT *,(((acos(sin((".$latitude."*pi()/180)) * sin((`lat`*pi()/180))+cos((".$latitude."*pi()/180)) * cos((`lat`*pi()/180)) * cos(((".$longitude."- `lng`)*pi()/180))))*180/pi())*60*1.1515*1.609344) as distance FROM `items` ORDER BY distance;
Gravatar
Fri May 01 06:06:49 -0700 2009
1
2
<link rel="stylesheet" type="text/css" media="print" href="print.css"/>
a[href]:after { content: " (" attr(href) ") "; }
Gravatar
Thu Apr 23 21:19:06 -0700 2009
1
sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
Gravatar
Mon Mar 23 12:39:39 -0700 2009
1
2
3
sub read_savedrecs {
  my $dir = shift;
  my (@rec, @head);
Gravatar
Fri Feb 27 19:16:09 -0800 2009
1
2
3
class Tag
  has_many :taggings
  named_scope :important, :include => { :taggings => :important }
Gravatar
Fri Feb 20 06:04:54 -0800 2009
1
2
3
sub read_file {
  my $file_name = shift;
  print STDERR "READ $file_name ... ";
Gravatar
Thu Feb 19 05:50:58 -0800 2009
1
2
3
find . -name "Thumbs.db" -exec rm '{}' \;
find . -name ".DS_Store" -exec rm '{}' \;
find . -name "*.THM" -exec rm '{}' \;
Gravatar
Thu Feb 19 05:36:05 -0800 2009
1
2
# touching a .gitignore file into all the empty subdirectories except the .git directory itself
find . \( -type d -empty \) -and \( -not -regex ./\.git.* \) -exec touch {}/.gitignore \;
gist: 63968 bin2tree.pl
Gravatar
Fri Feb 13 07:58:13 -0800 2009
1
2
3
#!/usr/bin/perl -w
use strict;
 
Gravatar
Fri Feb 13 07:20:19 -0800 2009
1
2
3
sub read_bin {
  my $file = shift;
  print STDERR "READ $file ... ";
Gravatar
Thu Feb 12 10:42:56 -0800 2009
1
2
3
# http://www.evanmiller.org/how-not-to-sort-by-average-rating.html
# Given the ratings I have, there is a 95% chance that the average rating is at least what?
# Score = Lower bound of Wilson score confidence interval for a Bernoulli parameter
Gravatar
Wed Jan 28 14:49:16 -0800 2009
1
2
3
# http://henrik.nyh.se/2008/12/git-dirty-prompt
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/
# username@Machine ~/dev/dir[master]$ # clean working directory
Gravatar
Thu Jan 08 07:00:23 -0800 2009
1
2
3
# 1) Point *.example.com in your DNS setup to your server.
#
# 2) Setup an Apache vhost to catch the star pointer:
Gravatar
Sat Sep 06 17:15:30 -0700 2008
1
2
3
def alphabetical_query_list(query)
  li = link_to_unless query.blank?, "All"
  list = [content_tag(:li, li)]
Gravatar
Tue Sep 02 01:31:53 -0700 2008
1
2
3
# Video: http://rubyhoedown2008.confreaks.com/08-chris-wanstrath-keynote.html
 
Hi everyone, I'm Chris Wanstrath.