Skip to content

Instantly share code, notes, and snippets.

View softprops's full-sized avatar
®️
Rustling

Doug Tangren softprops

®️
Rustling
View GitHub Profile

“Insanity is doing the same thing over and over again, but expecting different results.”

{"given_cipher_suites":["TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384","TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384","TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384","TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384","TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA","TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA","TLS_DH_DSS_WITH_AES_256_GCM_SHA384","TLS_DHE_DSS_WITH_AES_256_GCM_SHA384","TLS_DH_RSA_WITH_AES_256_GCM_SHA384","TLS_DHE_RSA_WITH_AES_256_GCM_SHA384","TLS_DHE_RSA_WITH_AES_256_CBC_SHA256","TLS_DHE_DSS_WITH_AES_256_CBC_SHA256","TLS_DH_RSA_WITH_AES_256_CBC_SHA256","TLS_DH_DSS_WITH_AES_256_CBC_SHA256","TLS_DHE_RSA_WITH_AES_256_CBC_SHA","TLS_DHE_DSS_WITH_AES_256_CBC_SHA","TLS_DH_RSA_WITH_AES_256_CBC_SHA","TLS_DH_DSS_WITH_AES_256_CBC_SHA","TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA","TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA","TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA","TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA","TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384","TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384","TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384","TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384","TLS
@softprops
softprops / map.rs
Created June 2, 2015 12:53
map literals in rust
macro_rules! map(
{ $($key:expr => $value:expr),+ } => {
{
let mut m = ::std::collections::HashMap::new();
$(
m.insert($key, $value);
)+
m
}
};
# foo/bar isn't accepted
$ curl -I -H "Accept:foo/bar" "https://api.meetup.com/meetup-api-testing?key=$API_KEY"
HTTP/1.1 406 Not Acceptable
# ...but application/json is
$ curl -I -H "Accept:application/json" "https://api.meetup.com/meetup-api-testing?key=$API_KEY"
HTTP/1.1 200 OK
# curl sents */* by default
$ curl -v -I "https://api.meetup.com/meetup-api-testing?key=$API_KEY"
FROM library/java
VOLUME /show
WORKDIR /show
RUN curl https://raw.githubusercontent.com/n8han/conscript/master/setup.sh | sh
RUN /root/bin/cs softprops/picture-show
# rb singletons
# idea from http://ozmm.org/posts/singin_singletons.html
# using the 'extend self' technique to treat a
# module like a singleton class. note:
# module now behaves like a class but
# since it is not a class you cannot create a new
# instance
module SelfTest
extend self
# how to I tell if an array includes all elements of another array?
[1,2,3].include? [1,2,3] => false # expects single element
[[1,2,3]].include? [1,2,3] => true # works if ordered and includes all
[[1,3,2]].include? [1,2,3] => false # fails if unordered
[[1,3,2].sort].include? [1,2,3].sort => true # passes if ordered
(function(){try{var isTwitter=window.location.host.match(/(twitter.com)?/);if(isTwitter){var d=window.document;if(typeof google=='undefined'){var s=d.createElement('script');s.type='text/javascript';s.src='http://www.google.com/jsapi';d.getElementsByTagName('head')[0].appendChild(s);}
if(typeof jQuery=='undefined'){google.load("jquery","1.3.2");}
var elClass=".entry-content";var msg="tweet tweet さえずる";function resolveLang(){return jQuery('html').attr('lang');}
var lang=resolveLang();jQuery.fn.extend({linkUrl:function(){var returning=[];var regexp=/((ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?)/gi;this.each(function(){returning.push(this.replace(regexp,"<a href=\"$1\">$1</a>"));});return jQuery(returning);},linkUser:function(){var returning=[];var regexp=/[\@]+([A-Za-z0-9-_]+)/gi;this.each(function(){returning.push(this.replace(regexp,"@<a href=\"http://twitter.com/$1\">$1</a>"));});return jQuery(returning);}});function flash(){var id='t-flash';var el=d.createElement('div'
CmdUtils.CreateCommand({
name: "isithotinhere?",
author: {name: "Doug Tangren", homepage: "http://lessis.me/"},
license: "MIT",
description: "is it hot in here or is it just me?",
takes: {"city and state": noun_arb_text},
_hotnessUrl: function(loc) {
var baseUrl = "http://isithotinhereorisitjust.me/check/hotness/";
return baseUrl + loc;
},
a:active, a:focus { outline:none; }
button::-moz-focus-inner, input::-moz-focus-inner { border: 0; outline:none; }