Skip to content

Instantly share code, notes, and snippets.

@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 {
@kamens
kamens / gist:4613457
Created January 23, 2013 21:15
How to limit the events that trigger a Github hook message
>>> import requests
>>> import json
>>> r = requests.get('https://api.github.com/repos/kamens/gae_mini_profiler/hooks', auth=('kamens', 'dontyouwish'))
>>> r.text
u'[{"config":{"restrict_to_branch":"","auth_token":"monkeysmonkeysmonkeys","room":"1s and 0s"},"url":"https://api.github.com/repos/kamens/gae_mini_profiler/hooks/629092","active":true,"test_url":"https://api.github.com/repos/kamens/gae_mini_profiler/hooks/629092/test","updated_at":"2013-01-23T18:59:08Z","last_response":{"status":"ok","message":"OK","code":200},"events":["commit_comment","download","fork","fork_apply","gollum","issues","issue_comment","member","public","pull_request","push","watch"],"name":"hipchat","id":629092,"created_at":"2013-01-04T19:53:44Z"}]'
# Note the id from the hook that you're interested in. In this case, it's 629092
id = 629092
@tbranyen
tbranyen / backbone_pushstate_router.js
Last active February 25, 2024 21:38
hijack links for pushState in Backbone
// All navigation that is relative should be passed through the navigate
// method, to be processed by the router. If the link has a `data-bypass`
// attribute, bypass the delegation completely.
$(document).on("click", "a[href]:not([data-bypass])", function(evt) {
// Get the absolute anchor href.
var href = { prop: $(this).prop("href"), attr: $(this).attr("href") };
// Get the absolute root.
var root = location.protocol + "//" + location.host + Application.root;
// Ensure the root is part of the anchor href, meaning it's relative.