Tag Archive for google

Irb power tricks with Wirble & Utility-Belt

## Required

# install
sudo gem install utility_belt

# settings for ~/.irbrc
require 'rubygems'
require 'utility_belt'
UtilityBelt::Themes.background(:light) #optional

## Now you can play in irb

# Interactively edit IRB code in TextMate
mate

# read from clipboard
MacClipboard.read

# write to clipboard
MacClipboard.write 'some text to be pasted elsewhere'

# review history
h # 'history' also works, but who wants to type?

# re-play last command
h!

# re-play arbitrary command from history
h! 123

# save history to some file
history_write('/path/to/file')

# find class name
grep_classes("num")
#=> ["Bignum", "Fixnum", "Numeric", "REXML::SyncEnumerator"]

# find method name
"foo".grep_methods("pretty")
#=> ["pretty_inspect", "pretty_print_instance_variables", ... ]

# google for whatever's in clipboard
google

# arbitrary google search
google singleWord
google 'multiple words'

source

Google Custom Search Engine from a List of Links

<!-- Use of this code assumes agreement with the Google Custom Search Terms of Service. -->
<!-- The terms of service are available at /coop/docs/cse/tos.html -->
<form name="cse" id="searchbox_demo" action="http://www.google.com/cse">
<input type="hidden" name="cref" value="" />
<input name="q" type="text" size="40" />
<input type="submit" name="sa" value="Search" />
</form>
<script type="text/javascript" src="http://www.google.com/cse/tools/onthefly?form=searchbox_demo"></script>

source

IE Issue decteing SSL for Google Analytics

For HTTP:
<script type="text/javascript" src="http://www.google-analytics.com/ga.js"></script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-XXXX-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>

For HTTPS:
<script type="text/javascript" src="https://ssl.google-analytics.com/ga.js"></script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-XXXX-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>

source

Google calendar embed

<iframe src="http://www.google.com/calendar/embed?height=600&amp;wkst=1&amp;bgcolor=%23FFFFFF&amp;src=GOOGLE_EMAIL_ADDRESS%40gmail.com&amp;color=%232952A3&amp;ctz=America%2FNew_York" style=" border-width:0 " width="800" height="600" frameborder="0" scrolling="no"></iframe>

source

Scrape Google from the command line

perl -e "$i=0;while($i<1000){sleep 1; open(WGET,qq/|xargs lynx -dump/);printf WGET qq{http://www.google.com/search?q=site:onemorebug.com&hl=en&start=$i&sa=N},$i+=10}" | grep "//[^/]*onemorebug.com/"

source

currency changer with google

<script type="text/javascript">

function callGoogle(){

var form=document.getElementById("Gform");
var link="http://www.google.hu/search?q="+form.elements["value"].value+"+"+form.elements["from"].value+"+to+"+form.elements["to"].value;
location.href=link;

}

</script>

<form id="Gform">

<input type="text" name="value" size="6">

<select name="from">
<option>EUR
<option>HUF
<option>GBP
<option>AUD
<option>CZK
<option>DKK
<option>JPY
<option>CAD
<option>PLN
<option>NOK
<option>CHF
<option>SEK
<option>SKK
<option>USD
</select>

TO

<select name="to">
<option>HUF
<option>GBP
<option>AUD
<option>CZK
<option>DKK
<option>EUR
<option>JPY
<option>CAD
<option>PLN
<option>NOK
<option>CHF
<option>SEK
<option>SKK
<option>USD
</select>

<input type="button" onclick="callGoogle()" value="Change!">

</form>

source

currency changer with google

<script type="text/javascript">

function callGoogle(){

var form=document.getElementById("Gform");
var link="http://www.google.hu/search?q="+form.elements["value"].value+"+"+form.elements["from"].value+"+to+"+form.elements["to"].value;
location.href=link;

}

</script>

<form id="Gform">

<input type="text" name="value" size="6">

<select name="from">
<option>EUR
<option>HUF
<option>GBP
<option>AUD
<option>CZK
<option>DKK
<option>JPY
<option>CAD
<option>PLN
<option>NOK
<option>CHF
<option>SEK
<option>SKK
<option>USD
</select>

TO

<select name="to">
<option>HUF
<option>GBP
<option>AUD
<option>CZK
<option>DKK
<option>EUR
<option>JPY
<option>CAD
<option>PLN
<option>NOK
<option>CHF
<option>SEK
<option>SKK
<option>USD
</select>

<input type="button" onclick="callGoogle()" value="Change!">

</form>

source

301 Redirect Google Safe

header("HTTP/1.1 301 Moved Permanently");
header("Location: <a href="http://www.newdomain.com/somepage.html"" >http://www.newdomain.com/somepage.html"</a>);

source

Remove Google Notebook text

#gnotes-statusbar-lbl {
display: none !important;
}

source

AppleSearch on your Website

<!-- Google CSE Search Box Begins -->
<form id="searchbox_009486749950716717919:edzcv6gfaeg" action="http://www.filippocorti.com/pages/page2/mac/result/">
<input type="hidden" name="cx" value="009486749950716717919:edzcv6gfaeg" />
<input name="q" type="text" size="40" />
<input type="submit" name="sa" value="Apple Search" />
<input type="hidden" name="cof" value="FORID:11" />
</form>
<script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=searchbox_009486749950716717919%3Aedzcv6gfaeg"></script>
<!-- Google CSE Search Box Ends -->

source