Skip to content

Instantly share code, notes, and snippets.

View richardsondx's full-sized avatar

Richardson Dackam richardsondx

View GitHub Profile
@richardsondx
richardsondx / pages _microposts.html.erb
Created April 4, 2012 19:50 — forked from radar/pages _microposts.html.erb
Endless page won't work with partial call instead of @render (which display my post with no css style)
<% for micropost in @microposts %>
<tr>
<td class="tdeux"><div class="head1"><%= image_tag("#{ micropost.to_guys ? "guys" : "girl" }-head.png") %></div></td>
<td valign="top"><p class="peopleposts"><%= link_to micropost.content, page_path(micropost) %></p></td>
<td class="td2"><div class="share1"><%= tweet_button(:via => "hmdy", :url => "http://localhost:3000/pages/#{micropost.id}", :text => "#{@micropost.content}", :lang => "en", :related => "helpmedateyou", :count => "none") %></div></td>
</tr>
<% end %>
@richardsondx
richardsondx / gist:2361419
Created April 11, 2012 19:00 — forked from stuross/gist:1649731
hack to fill gaps in masonry
/**
* jQuery Masonry v2.1.01
* A dynamic layout plugin for jQuery
* The flip-side of CSS Floats
* http://masonry.desandro.com
*
* Licensed under the MIT license.
* Copyright 2011 David DeSandro
*/
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no"/>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?1.29.1"></script>
<style type="text/css">
html, body, #map {
width: 100%;
<li>
<%= truncate(experience.content, length: 200) { button_to "Continue", { action: "#" }, method: :get } %>
</li>
<li>
<%= truncate(experience.content, length: 200) { button_to "Continue", { action: "#" }, method: :get } %>
</li>
me = User.create(*all the info*)
ruby = Language.create(name: 'ruby')
python = Language.create(name: 'python')
UsersLanguage.add_language(python, me)
=> true
UsersLanguage.add_language(ruby, me)
=> true
@richardsondx
richardsondx / sort.rb
Last active August 29, 2015 14:06 — forked from aspyct/sort.rb
# Sample implementation of quicksort and mergesort in ruby
# Both algorithm sort in O(n * lg(n)) time
# Quicksort works inplace, where mergesort works in a new array
def quicksort(array, from=0, to=nil)
if to == nil
# Sort the whole array, by default
to = array.count - 1
end
@richardsondx
richardsondx / ssl_puma.sh
Created February 25, 2016 18:40 — forked from tadast/ssl_puma.sh
localhost SSL with puma
# 1) Create your private key (any password will do, we remove it below)
$ cd ~/.ssh
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
@richardsondx
richardsondx / howto-manually-add-trust-cert-to-rubygems.md
Created March 4, 2016 07:15
Workaround RubyGems' SSL errors on Ruby for Windows (RubyInstaller)

SSL upgrades on rubygems.org and RubyInstaller versions

UPDATE 2014-12-21: RubyGems 1.8.30, 2.0.15 and 2.2.3 have been released. It requires manual installation, please see instructions below.


Hello,

If you reached this page, means you've hit this SSL error when trying to

@richardsondx
richardsondx / solution.md
Created March 4, 2016 14:47 — forked from kendagriff/solution.md
Solution to "OpenSSL::X509::StoreError: setting default path failed: Invalid keystore format" for JRuby

Solution to StoreError: invalid keystore format (OS X)

The following error appeared upon upgrading JRuby:

OpenSSL::X509::StoreError: setting default path failed: Invalid keystore format

Download cacert.pem