Skip to content

Instantly share code, notes, and snippets.

@danshultz
danshultz / host-ember-app.md
Created March 1, 2015 21:13
Hosting Ember App on S3
  1. Use ember-deploy + ember-deploy-s3 + ember-deploy-s3-index
  2. npm install --save-dev ember-deploy ember-deploy-s3 ember-deploy-s3-index
  3. Update nginx with the following config
server {
  listen 80;
  server_name foo.example.dev;
  location / {
    set $s3_bucket 'my-ember-app-index.s3.amazonaws.com';
    set $url_full         '$1';
@danshultz
danshultz / user-agent.json
Created September 13, 2013 17:40
Kibana Graphs
{
"title": "user-agent",
"rows": [
{
"title": "Options",
"height": "50px",
"editable": true,
"collapse": false,
"collapsable": true,
"panels": [
@danshultz
danshultz / patch-adapter.js
Created March 23, 2015 01:40
Ember Data Patch Support
import Ember from 'ember';
var get = Ember.get;
export default Ember.Mixin.create({
updateRecord: function (store, type, record) {
var data = {};
var serializer = store.serializerFor(type.typeKey);
@danshultz
danshultz / keybase.md
Created April 7, 2016 14:30
keybase.md

Keybase proof

I hereby claim:

  • I am danshultz on github.
  • I am danshultz (https://keybase.io/danshultz) on keybase.
  • I have a public key whose fingerprint is 2C7F 7E83 2B35 8070 5230 DCF3 4B6A 6969 6764 D1E8

To claim this, I am signing this object:

@danshultz
danshultz / OnException.cs
Created July 3, 2013 15:23
.NET MVC Sentry logging in OnException
public RavenClient raven
{
get
{
var ravenKey = "raven_key";
var raven = new RavenClient(ravenKey);
return raven;
}
}
module ActiveRecord
module ConnectionAdapters
class Mysql2Adapter
alias :build_table_structure :structure_dump
def structure_dump
build_table_structure << build_view_structure << build_function_structure
end
@danshultz
danshultz / iframe-normalizer.js
Last active January 1, 2016 05:49
Sandboxing content in an iframe
/*globals $:true*/
(function () {
var resizeInterval = 42;
var resizeLimit = 1000 / 41 * 5;
var initialize = function () {
$('iframe[data-normalize]').each(function () {
$(this).on('load', normalizeIframe);
});
};
*.csproj text=auto merge=union
*.sln -text merge=union
@danshultz
danshultz / kibana-three
Created September 27, 2013 13:42
Simple ngxin config Taken from my Kibana three config
server {
listen *:80 ;
access_log /var/log/nginx/kibana.access.log;
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/.htpasswd;
location / {
root /var/www/apps/kibana_three/current;
@danshultz
danshultz / dump_errors.rb
Created August 7, 2013 18:08
Errbit Errors to ElasticSearch/Kibana
require 'net/http'
require 'json'
require 'time'
es_host = "127.0.0.1"
es_port = "9200"
host = Net::HTTP.new(es_host, es_port)
apps = %w(App1 App2)