Skip to content

Instantly share code, notes, and snippets.

View joelr's full-sized avatar

Joel Richards joelr

View GitHub Profile
@joelr
joelr / install-comodo-ssl-cert-for-nginx.rst
Created November 11, 2016 02:06 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@joelr
joelr / gist:ad96329391d36d2325833eeb8230a75d
Created October 24, 2016 05:01 — forked from timblair/gist:942151
National Rail really is run by a bunch of monkeys...
$ curl --silent -i http://ojp.nationalrail.co.uk/ | grep 'Powered-By'
X-Powered-By: An infinite number of monkeys
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script type='text/javascript'>
$(function() {
$.getJSON('http://api.jo.je/justgiving/jsonp.php?d=Team-Prologis&callback=?', {}, function (data) {
$("#raised-jg").html(data.donations_total);
OmniAuth::Strategies::Passport.default_options.client_options.site = 'http://localhost:3009'
@joelr
joelr / gist:4690768
Created February 1, 2013 11:27
Random purchaser
cart = Cart.new
cart.add_product RandomProduct.find
puts cart.total
cart.pay
#Gives me:
$ ruby app.rb
Adding Motion Activated Flashing RGB LED Wheel Lights for Bikes and Cars (2-Pack)
151341
160499
168617
1223
181622
1138
27725
37373
57440
1489
"--- !ruby/object:MIME::Type\ncontent-type: image/jpeg\nfriendly:\n en: JPEG Image\nencoding: base64\nextensions:\n- jpeg\n- jpg\n- jpe\nreferences:\n- IANA\n- RFC2045\n- RFC2046\nxrefs: !ruby/hash:MIME::Types::Container\n rfc:\n - rfc2045\n - rfc2046\nregistered: true"
@joelr
joelr / LB example.md
Last active October 19, 2015 23:07
LB example.md

sort_by=calories&group_by=team&filter[campaign]=au-123,au-456&filter[date_start]=2015-01-01&filter[date_end]=2015-01-01 This should group by team_page_id on the document

[
   {
     team: {
       name: 'Team abc',
 url: 'http://def',
#Not between 5:30pm Friday and 5:30pm Sunday
def support_available?(time_check = nil)
time_check ||= Time.now
!(time_check.wday == 6 || (time_check.wday == 5 && (time_check.hour > 17 || (time_check.hour == 17 && time_check.min >= 30))) || (time_check.wday == 0 && (time_check.hour < 17 || (time_check.hour == 17 && time_check.min <= 30))))
end
** [out :: 10.21.88.51]
** [out :: 10.21.88.51] WARNING on line 114 of /var/www/apps/supporter/releases/20150205232915/app/assets/stylesheets/shared/_form_fields.css.sass: ".form__field--search" failed to @extend "%padding-r-l".
** [out :: 10.21.88.51] The selector "%padding-r-l" was not found.
** [out :: 10.21.88.51] This will be an error in future releases of Sass.
** [out :: 10.21.88.51] Use "@extend %padding-r-l !optional" if the extend should be able to fail.
** [out :: 10.21.88.51]
** [out :: 10.21.88.51]
** [out :: 10.21.88.51] WARNING on line 114 of /var/www/apps/supporter/releases/20150205232915/app/assets/stylesheets/shared/_form_fields.css.sass: ".form__field--search" failed to @extend "%padding-r-l".
** [out :: 10.21.88.51] The selector "%padding-r-l" was not found.
** [out :: 10.21.88.51] This will be an error in future releases of Sass.