Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

About this user

john manoogian III http://jm3.net

« Newer Snippets
Older Snippets »
Showing 1-10 of 13 total  RSS 

how to create a new user in MySQL

// first, mysql -uroot mysql
// then:


  mysql% GRANT ALL PRIVILEGES ON *.* TO 'jm3_spoon'@'localhost' IDENTIFIED BY 'stirthatshit' WITH GRANT OPTION;
  mysql% create database jm3_agitator;

google / urchin analytics

what up with this style of google analytics implementation?

<body onload="_uacct='UA-XXXXXX-X';urchinTracker();init();">

dynamic rails img headers

// description of your code here

find views -name [a-z]\*rhtml | xargs -n1 grep -H "@page_title" | grep -v "<%" | sed "s/\@page_title = //" | sed "s/rhtml/png/" | sed "s:views/::" | sed "s:/:_:g" | sed "s:^:public/images/beta/headers/hdr_:" | sed "s/  //g"

disable SQL / MySQL in rails logging in development mode

// description of your code here

ActiveRecord::Base.logger = Logger.new("#{RAILS_ROOT}/log/#{RAILS_ENV}_database.log")



goes at end of config/env

toggle between last edited buffer : control-shift-6

// description of your code here

// insert code here..

bash : make tab completion of similarly named files not suck ass

// description of your code here

add this to your ~/.bashrc (auto-chooses the first completion and cycles thru them w/tab)
bind '"\t":menu-complete'


and / or add this to your ~/.inputrc (shows all completions right away)
set show-all-if-ambiguous on

hitbox / WSS docs

from pro-serve training: http://pso.hitbox.com/edmu/200607/

unix wizards of the realm:

// SVN ignore based on .cvsignore file:

svn propset svn:ignore -F .cvsignore .


// grep:
with line number: -nwith file name: -H


// os x housekeeping:


// install perl module:
sudo perl -MCPAN -e 'install Bundle::LWP'


// meta refresh (i have never typed this line start to finish in my life. i have probably copy-pasted it 7,000 times
<meta http-equiv=Refresh content="0; URL=http://blog.jm3.net/" />


// get files off codeswami:
ssh -l cs 208.101.26.91


// SQL tricks:
http://jm3.net/cgi-bin/safe/wiki.pl?MySqlLibrary

enable svn $Id$-style keywords

svn propset svn:keywords "Date Author Id Revision" *css
« Newer Snippets
Older Snippets »
Showing 1-10 of 13 total  RSS