Skip to content

Instantly share code, notes, and snippets.

View stevedev's full-sized avatar

Steve Thompson stevedev

View GitHub Profile
@stevedev
stevedev / scrabble.rb
Created December 14, 2018 18:00
Scrabble for slack...
#!/usr/bin/env ruby
VALUES = [
[1, %w{ e a o t i n r }],
[2, %w{ d g }],
[3, %w{ c m b p }],
[4, %w{ h f w y v }],
[5, %w{ k }],
[8, %w{ h x }],
[10, %w{ q z }]
@stevedev
stevedev / fish
Created August 28, 2017 20:06
Fish tank generator for slack. Because.
#!/usr/bin/ruby
# some fish!
fish = %w{ fish fish2 fish3 fish4 fish5 fish6 fish7 }
# At least 3 lines
lines = rand(4) + 3
output = ""
-# email :string(255) default(""), not null
-# encrypted_password :string(255) default(""), not null
-# reset_password_token :string(255)
+# email :string default(""), not null
+# encrypted_password :string default(""), not null
+# reset_password_token :string
def generate_unique_token
self.confirmation_token = loop do
random_token = SecureRandom.urlsafe_base64(nil, false)
break random_token unless User.exists?(confirmation_token: random_token)
end
end
<?xml version="1.0"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" height="380" version="1.1" width="670" style="overflow: hidden; position: relative; left: -0.328125px;" viewBox="0 0 670 380" preserveAspectRatio="xMinYMin">
<desc style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);">Created with Rapha&#xEB;l 2.1.2</desc>
<defs style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);"/>
<rect x="0" y="0" width="670" height="410" r="0" rx="0" ry="0" fill="#ffffff" stroke="#ffffff" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);"/>
<image x="0" y="0" width="670" height="380" preserveAspectRatio="none" xlink:href="data:image/jpg;base64,iVBORw0KGgoAAAANSUhEUgAAAlgAAAFeCAYAAABZ12FcAAAAGXRFWHRTb2Z0&#10;d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2hpVFh0WE1MOmNvbS5hZG9i&#10;ZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2Vo&#10;aUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6&#10;bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYxIDY0&#10;LjE0MDk0

Home Page Priorities:

  • Product Sample:

    • allows buyers to see product in their area right away
    • shows that we are serious and have listings
    • demonstrates quality and type of product
  • Builder Onboarding:

    • Why list on NHLS?
root@staging:/etc/nginx# nginx -V
nginx version: nginx/1.1.19
TLS SNI support enabled
configure arguments: --prefix=/etc/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-log-path=/var/log/nginx/access.log --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --lock-path=/var/lock/nginx.lock --pid-path=/var/run/nginx.pid --with-debug --with-http_addition_module --with-http_dav_module --with-http_geoip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_realip_module --with-http_stub_status_module --with-http_ssl_module --with-http_sub_module --with-http_xslt_module --with-ipv6 --with-sha1=/usr/include/openssl --with-md5=/usr/include/openssl --with-mail --with-mail_ssl_module --add-module=/build/buildd/nginx-1.1.19/debian/modules/nginx-auth-pam --add-module=/build/buildd/n
@stevedev
stevedev / poly_center.coffee.js
Created June 18, 2014 16:14
Google Maps Polygon Center
google.maps.Polygon::Center = ->
PI = 22 / 7
X = 0
Y = 0
Z = 0
@getPath().forEach (vertex, inex) ->
lat1 = vertex.lat()
lon1 = vertex.lng()
lat1 = lat1 * PI / 180
lon1 = lon1 * PI / 180
@stevedev
stevedev / gist:a08fd663fc9390f0b12f
Created June 6, 2014 23:03
Get centroid for polygon in Google Maps
google.maps.Polygon::getArea = ->
points = @getPaths()
area = 0
i = 0
j = points.length - 1
while i < points.length
point1 = points[i]