Skip to content

Instantly share code, notes, and snippets.

View benschwarz's full-sized avatar
🏁
Making the web fast

Ben Schwarz benschwarz

🏁
Making the web fast
View GitHub Profile
@benschwarz
benschwarz / pg.md
Last active December 15, 2020 04:20
Awesome postgres

Keybase proof

I hereby claim:

  • I am benschwarz on github.
  • I am benschwarz (https://keybase.io/benschwarz) on keybase.
  • I have a public key whose fingerprint is E7EA A491 E183 AA96 7629 BD41 F719 7B3B 8B26 9972

To claim this, I am signing this object:

.btn-group-vertical>.btn:not(:first-child):not(:last-child),
.btn-group-vertical>.col-signup .signup .btn-facebook:not(:first-child):not(:last-child),
.btn-group-vertical>.col-signup .signup .btn-google:not(:first-child):not(:last-child),
.btn-group-vertical>.col-signup .signup .btn-login:not(:first-child):not(:last-child),
.btn-group-vertical>.col-signup .signup .btn-signup:not(:first-child):not(:last-child),
.btn-group-vertical>.frm-no-account .btn-go:not(:first-child):not(:last-child),
.btn-group-vertical>.nav-bar .menu-search li .btn-close:not(:first-child):not(:last-child),
.btn-group-vertical>.nav-bar .menu-search li .btn-search:not(:first-child):not(:last-child),
.btn-group-vertical>div[chart-view] .tablet-switch .first-half-btn:not(:first-child):not(:last-child),
.btn-group-vertical>div[chart-view] .tablet-switch .second-half-btn:not(:first-child):not(:last-child),
@benschwarz
benschwarz / README.md
Created October 14, 2015 14:56
Intercom CSP (Content security policy)

You'll need to add a whole slew of hosts for intercom if you've got CSP in place (which you should).

Heres what you'll need to add:

connect-src: https://api-ping.intercom.io https://nexus-websocket-a.intercom.io https://nexus-websocket-b.intercom.io wss://nexus-websocket-a.intercom.io wss://nexus-websocket-b.intercom.io https://api-iam.intercom.io 
script-src: https://widget.intercom.io https://js.intercomcdn.com
image-src: https://js.intercomcdn.com
@benschwarz
benschwarz / gist:4171d8795b4f1f651a97
Last active August 29, 2015 14:16
iPhone games suggested to me by Twitter friends
  • Pocket dog fights
  • Battleheart
  • Steampunk
  • Bonza
  • Thomas was alone
  • Space age
  • Fotonica
  • 80 days
  • Sorcery!
  • Powder
@benschwarz
benschwarz / bower.schema
Created June 10, 2014 01:01
Bower registry schema
--
-- PostgreSQL database dump
--
-- Dumped from database version 9.3.4
-- Dumped by pg_dump version 9.3.4
-- Started on 2014-06-10 10:42:59 EST
SET statement_timeout = 0;
SET lock_timeout = 0;
@benschwarz
benschwarz / .bowerrc
Last active April 3, 2019 07:55
Bower + Rails asset pipeline
{
"directory": "vendor/assets/components"
}
@benschwarz
benschwarz / csrf-token.js
Created April 7, 2013 23:11
Set the CSRF token for Rails when doing Ajax requests
define( ['jquery'], function ( $ ) {
var token = $( 'meta[name="csrf-token"]' ).attr( 'content' );
$.ajaxSetup( {
beforeSend: function ( xhr ) {
xhr.setRequestHeader( 'X-CSRF-Token', token );
}
});
return token;
<link rel="stylesheet" href="/stylesheets/screen.css">
<link rel="stylesheet" href="/stylesheets/narrow.css" media="screen and (max-width: 44em)">
<link rel="stylesheet" href="/stylesheets/medium.css" media="screen and (min-width: 44em) and (max-width: 65em)">
<link rel="stylesheet" href="/stylesheets/wide.css" media="screen and (min-width: 44em)">
<!--[if (gte IE 6)&(lte IE 8)]>
<link rel="stylesheet" href="/stylesheets/wide.css">
<script src="/javascripts/nwmatcher.min.js"></script>
<script src="/javascripts/selectivizr.min.js"></script>
<![endif]-->
@benschwarz
benschwarz / vector-bg-with-fallback.scss
Last active May 19, 2017 01:30
SVG background image with PNG fallback (Sass mixin)
$public_path: "./";
@mixin vector-bg-with-fallback($name) {
background-image: url('#{$public_path}images/#{$name}.png');
background-image: none, url('#{$public_path}images/#{$name}.svg');
}