Skip to content

Instantly share code, notes, and snippets.

View mrryanjohnston's full-sized avatar
😎
Set your status

Ryan Johnston mrryanjohnston

😎
Set your status
View GitHub Profile
@mrryanjohnston
mrryanjohnston / components.hidden-attribute.js
Last active July 31, 2019 14:06
attributeBindings hidden
import Ember from 'ember';
export default Ember.Component.extend({
attributeBindings: ['hidden'],
hidden: true
});
@mrryanjohnston
mrryanjohnston / whatismyip.sh
Last active May 18, 2019 15:12
Script to return your public IP from duckduckgo
#!/bin/bash
curl -fs "https://api.duckduckgo.com/?q=ip&format=json" | jq -r '.Answer' | awk '{print $5}'
@mrryanjohnston
mrryanjohnston / components.proxy-list.js
Last active February 8, 2019 17:53
Proxy Array with Record Fadeout
import Ember from 'ember';
import { copy } from '@ember/object/internals';
import { later } from '@ember/runloop';
import { set } from '@ember/object';
export default Ember.Component.extend({
didReceiveAttrs () {
this._super(...arguments);
if (!this.recordsProxy) {
this.recordsProxy = copy(this.records);
@mrryanjohnston
mrryanjohnston / components.my-component.js
Last active February 8, 2019 08:25
Delete items with Animation
import Ember from 'ember';
export default Ember.Component.extend({
actions: {
delete () {
this.delete();
}
}
});

String#my_to_i

Description

Custom implementation of String's to_i method

Usage

require_relative 'string'
@mrryanjohnston
mrryanjohnston / README.md
Created June 14, 2018 21:42
Change Maker

Change Maker

Description

Makes change for configured currencies.

Usage

# Initialize your changemaker
@mrryanjohnston
mrryanjohnston / Gemfile
Last active June 7, 2018 00:05
Even Fibonacci Numbers
source 'https://rubygems.org'
gem 'rspec'
@mrryanjohnston
mrryanjohnston / Dockerfile
Created March 9, 2014 01:38
Golang development environment using Docker
FROM ubuntu:13.10
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install golang
RUN mkdir /go
RUN export GOPATH=/go
ENV GOPATH /go
RUN export PATH=$PATH:$GOPATH/bin
@mrryanjohnston
mrryanjohnston / Dockerfile
Created February 23, 2014 18:50
nginx with php5-fpm on Ubuntu 13.10 Dockerfile
FROM ubuntu:13.10
RUN apt-get update
# nginx
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install nginx
RUN echo "daemon off;" >> /etc/nginx/nginx.conf
# php5-fpm
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install php5-fpm
@mrryanjohnston
mrryanjohnston / Dockerfile
Created January 31, 2014 07:23
Running Jekyll from a Docker container. Uses a busybox container to host the Jekyll data (see http://docs.docker.io/en/latest/use/working_with_volumes/).
FROM ubuntu:12.04
#Install Ruby
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install ruby1.9.1 ruby1.9.1-dev make
#Pygments doesn't seem to want to work regardless of version installed
RUN gem install pygments.rb
#Install Jekyll
RUN gem install jekyll