Skip to content

Instantly share code, notes, and snippets.

View srathbone's full-sized avatar

Stephen Rathbone srathbone

  • East Midlands, UK
View GitHub Profile
@konklone
konklone / ssl.rules
Last active May 19, 2024 18:02
nginx TLS / SSL configuration options for konklone.com
# Basically the nginx configuration I use at konklone.com.
# I check it using https://www.ssllabs.com/ssltest/analyze.html?d=konklone.com
#
# To provide feedback, please tweet at @konklone or email eric@konklone.com.
# Comments on gists don't notify the author.
#
# Thanks to WubTheCaptain (https://wubthecaptain.eu) for his help and ciphersuites.
# Thanks to Ilya Grigorik (https://www.igvita.com) for constant inspiration.
server {
@mnapoli
mnapoli / behat-reference.feature
Last active February 12, 2024 10:54
Behat Mink reference
# Given
Given I am on [the] homepage
Given I am on "url"
# When
When I go to [the] homepage
When I go to "url"
When I reload the page
@Andrzej
Andrzej / bson2sql.rb
Created October 10, 2011 19:16
Convert BSON file into SQL, useful for fast copy data from MongoDB to MySQL (mongodump => bson2sql => import to mysql)
require "bson"
def make_insert(table_name, bson)
columns = ["id",*bson["value"].keys] * ", "
values = ["'#{bson["_id"]}'",*bson["value"].values.map{|value| value.is_a?(Numeric) ? value : "'#{value}'"}] * ", "
return "insert into #{table_name} (#{columns}) values (#{values});"
end
file_name = ARGV.first
file=File.new(file_name)