Skip to content

Instantly share code, notes, and snippets.

View simplesessions's full-sized avatar
💭
Busy, busy, busy!

Charles Kihe simplesessions

💭
Busy, busy, busy!
View GitHub Profile
/**
* Solution to the following:
* Given a dictionary, output all word pairs where both words share all their letters except the last two, which are distinct and reversed.
*
* Notes:
* - Use a reasonable dictionary of your choice
* - Potential word pairs are: "ear, era" ; "revies, revise" ; "burglaries, burglarise"
* - "shear, era" is not a valid pair because "she" != "e"
* - "bell, bell" is not a valid pair because the last two letters are not distinct
* - This will be benchmarked
# Solution to the following:
# Given a dictionary, output all word pairs where both words share all their letters except the last two, which are distinct and reversed.
#
# Notes:
# - Use a reasonable dictionary of your choice
# - Potential word pairs are: "ear, era" ; "revies, revise" ; "burglaries, burglarise"
# - "shear, era" is not a valid pair because "she" != "e"
# - "bell, bell" is not a valid pair because the last two letters are not distinct
# - This will be benchmarked
# - Work on this problem in C, C++, Java, Perl, PHP, Python or a similar language.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
@simplesessions
simplesessions / dabblet.css
Created December 16, 2011 00:06
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
@simplesessions
simplesessions / index.html
Created September 25, 2012 21:36
Recreating the SIRI icon with no images or javascript. Four HTML elements have been used so far and the CSS is very messy. I hope to clean this up in the future. This will be an on-going build.
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Source+Code+Pro:200,300" media="screen">
<div id="siri">
<div id="spin"></div>
<a id="icon">
<span class="highlights"></span>
</a>
</div>
@simplesessions
simplesessions / index.html
Created September 25, 2012 21:36
Recreating the SIRI icon with no images or javascript. Four HTML elements have been used so far and the CSS is very messy. I hope to clean this up in the future. This will be an on-going build.
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Source+Code+Pro:200,300" media="screen">
<div id="siri">
<div id="spin"></div>
<a id="icon">
<span class="highlights"></span>
</a>
</div>
#<Twitter::Tweet:0x007f8751763768 @attrs={:created_at=>"Tue Jun 18 18:47:34 +0000 2013", :id=>347063051306020864, :id_str=>"347063051306020864", :text=>"Hashtags or hashbrowns? #hashtags #or #hashbrowns", :source=>"web", :truncated=>false, :in_reply_to_status_id=>nil, :in_reply_to_status_id_str=>nil, :in_reply_to_user_id=>nil, :in_reply_to_user_id_str=>nil, :in_reply_to_screen_name=>nil, :user=>{:id=>1525082400, :id_str=>"1525082400", :name=>"Wall-to-Wall Devs", :screen_name=>"WW_webdev", :location=>"", :description=>"", :url=>nil, :entities=>{:description=>{:urls=>[]}}, :protected=>false, :followers_count=>1, :friends_count=>5, :listed_count=>0, :created_at=>"Mon Jun 17 15:16:34 +0000 2013", :favourites_count=>0, :utc_offset=>nil, :time_zone=>nil, :geo_enabled=>false, :verified=>false, :statuses_count=>4, :lang=>"en", :contributors_enabled=>false, :is_translator=>false, :profile_background_color=>"C0DEED", :profile_background_image_url=>"http://a0.twimg.com/images/themes/theme1/bg.png", :profile_background_
# assuming that you got the tweet back and assgined it to "tweet"
output = tweet[:text].tap do |t|
tweet[:entities][:hashtags].reverse.each do |h|
t[h[:indices][0], h[:indices][1] - h[:indices][0]] = "<a href=\"\#\">\##{h[:text]}</a>"
end
end
@simplesessions
simplesessions / gist:7033448
Last active December 25, 2015 20:18
Performant way of checking document size?
windowResizeHandler = null;
$(window).resize(function() {
clearTimeout(windowResizeHandler);
windowResizeHandler = setTimeout(function() {
var docWidth = $('document').width();
if (docWidth > 200) {
// do some'n
}
}, 250);
mixin tabMenu
ul.menu.tabs(data-tab role="tablist")
if block
block
mixin tabMenuItem(id, label, active)
li(class="tab-title"+(active ? " active" : "") role="presentational")
a(href=("#"+id) role="tab" tabindex="0" aria-selected="true" controls=id)=label
mixin tabContentContainer