Skip to content

Instantly share code, notes, and snippets.

Avatar

Nathaniel Bibler nbibler

View GitHub Profile
@nbibler
nbibler / caller.hbs
Created Nov 5, 2020
Video.js, TypeScript, traditional Ember Component
View caller.hbs
<MyVideo @video={{someVideoModelInstance}}/>
@nbibler
nbibler / test.rb
Created Jan 30, 2019
Ruby Digest::MD5 update vs hexdigest comparison
View test.rb
#!/usr/bin/env ruby -w
# frozen_string_literal: true
require 'bundler/inline'
gemfile(true) do
source 'https://rubygems.org'
gem 'benchmark-memory'
end
View profile.rb
# frozen_string_literal: true
require 'bundler/inline'
gemfile(true) do
source 'https://rubygems.org'
gem 'benchmark-memory', require: false
end
require 'benchmark'
@nbibler
nbibler / diff-to-release.sh
Last active Sep 4, 2018
Query a server's Rapporteur (or other) revision and compare it to the local git revision
View diff-to-release.sh
#!/bin/bash
set -e
status_url=$1
local_revision=$(git rev-parse HEAD)
printf "%40s %-20s\n" $local_revision "Local"
remote_revision=$(curl --compressed --get --silent "$status_url" | jq --compact-output --monochrome-output '.revision' | tr -d '"')
printf "%40s %-20s\n" $remote_revision "Remote"
@nbibler
nbibler / christmas_formatter.rb
Last active Dec 8, 2016
Passed: 🎄, Pending: 🎀, Failed: 🎁
View christmas_formatter.rb
# bundle exec rspec --require ./christmas_formatter.rb --format ChristmasFormatter
require "rspec/core/formatters/base_text_formatter"
require "rspec/core/formatters/console_codes"
class ChristmasFormatter < RSpec::Core::Formatters::BaseTextFormatter
RSpec::Core::Formatters.register self, :example_passed, :example_pending, :example_failed, :start_dump
FAIL_EMOJI = "\u{1f381}"
PASS_EMOJI = "\u{1f384}"
View components.ivy-tab-list.js
import Ember from 'ember';
import layout from '../templates/components/ivy-tab-list';
/**
* @module ivy-tabs
*/
/**
* @class IvyTabListComponent
* @namespace IvyTabs
@nbibler
nbibler / cookie.rb
Last active Jun 27, 2016
Decrypt Rails 4 session cookies
View cookie.rb
@nbibler
nbibler / application.controller.js
Last active Nov 2, 2015
Ember Component preventDefault with click
View application.controller.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});
@nbibler
nbibler / application.controller.js
Last active Oct 29, 2015
Nested Routes and Models
View application.controller.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});
@nbibler
nbibler / cleanup.sh
Created Oct 23, 2015
Clean up old Capistrano releases
View cleanup.sh
for dir in `find ./* -maxdepth 1 -type d -name "releases"`; do echo $dir; for release in `ls -t $dir | awk 'NR>5'`; do echo removing $dir/$release; rm -rf $dir/$release; done; done
You can’t perform that action at this time.