Skip to content

Instantly share code, notes, and snippets.

View ETBlue's full-sized avatar

ETBlue ETBlue

View GitHub Profile
@ETBlue
ETBlue / global_keybindings.entries
Created October 25, 2010 22:27
global_keybindings.entries of my Ubuntu netbook
<gconfentryfile>
<entrylist base="/apps/metacity/global_keybindings">
<entry>
<key>cycle_group</key>
<schema_key>/schemas/apps/metacity/global_keybindings/cycle_group</schema_key>
<value>
<string></string>
</value>
</entry>
<entry>
@ETBlue
ETBlue / Blogger-to-Plurk-share-button
Created December 28, 2010 05:53
Blogger-to-Plurk-share-button
<a class='sb-plurk' expr:href='&quot;http://plurk.com/?qualifier=shares&amp;status=&quot; + data:post.url + &quot; &quot; + &quot;(&quot; + data:post.title + &quot;)&quot;' target='_blank' title='分享至 Plurk'>
<span class='share-button-link-text'>分享至 Plurk</span></a>
<script type="text/javascript">
var csvFile=new XMLHttpRequest();
var filePath="file:///home/etblue/Codes/translation/rails-guide-glossary-list-zh_tw.csv"
csvFile.open("GET", filePath, false);
csvFile.send();
glossary = csvFile.responseText.split("\n");
for(var i=0;i<glossary.length;i++)
<style type='text/css'>
.post-share-buttons {
width:145px;
}
.sb-plurk {
background:url(http://www.etblue.idv.tw/blogs/sb-plurk.png) no-repeat left top !important;
}
a:hover.sb-plurk {
background:url(http://www.etblue.idv.tw/blogs/sb-plurk-hover.png) no-repeat left top !important;
}
<a class='goog-inline-block share-button sb-plurk' expr:href='&quot;http://plurk.com/?qualifier=shares&amp;status=&quot; + data:post.url + &quot; &quot; + &quot;(&quot; + data:post.title + &quot;)&quot;' target='_blank' title='分享至 Plurk'>
<span class='share-button-link-text'>分享至 Plurk</span></a>
@ETBlue
ETBlue / preview-comment-step-8
Created March 14, 2011 22:52
preview-comment-step-8
<b:if cond='data:blog.pageType != &quot;item&quot;'>
<b:if cond='data:blog.pageType != &quot;static_page&quot;'>
<b:if cond='data:post.allowComments'>
<b:if cond='data:post.numComments == 0'>
<a class='comment-link' expr:href='data:post.addCommentUrl'>留下回應</a>
<b:else/>
<a class='comment-preview' expr:onclick='&quot;var comments= \&quot;&quot; +data:post.id+ &quot;_comment-preview\&quot;; var url=\&quot;&quot; +data:post.addCommentUrl+ &quot;\&quot;; $(\&quot;#\&quot;+comments).toggle(); $(\&quot;.\&quot;+comments).load(url+ \&quot; #Blog1_comments-block-wrapper\&quot;);&quot;' href='javascript:void(0)' title='預覽回應 preview comments'>
預覽 <b:if cond='data:post.numComments == 1'>1 <data:top.commentLabel/><b:else/><data:post.numComments/> <data:top.commentLabelPlural/></b:if></a>
</b:if>
</b:if>
@ETBlue
ETBlue / facebook-comment-box.xfbml
Created April 29, 2011 11:29
facebook-comment-box
<div id='fb-root'/><script src='http://connect.facebook.net/en_US/all.js#appId=APP_ID&amp;xfbml=1'/><fb:comments expr:href='data:post.url' num_posts='3' width='600'/>
@ETBlue
ETBlue / blogger-hide-lang-button
Created May 29, 2011 12:16
conditional hide language switch button in Blogger
<script type="text/javascript">
var postUrl = "/2011/03/blogger-steps-add-language-switch.html";
var currentUrl = window.location.pathname;
if (postUrl != currentUrl) {
$('.lang-switch-button').toggle();
}
</script>
def get_size
print"\n how many rows/columns do you wish to have? (please input a number between 4 and 100:) "
# ask user to input the correct format over and over again
while
table_size=gets.chomp.to_i
# start over if the format is incorrect
if !table_size || table_size<4 || table_size>100
print"\n please give me an integer between 4 and 100: "
# header
puts "\n--------------------------\n * Multiplication Table * \n--------------------------"
# body
(1..9).each{|y|
# one row
(1..9).each{|x|
number=x*y