Skip to content

Instantly share code, notes, and snippets.

View joshuaogle's full-sized avatar
👨‍🎨
Making the cloud a better place to live

Joshua Ogle joshuaogle

👨‍🎨
Making the cloud a better place to live
View GitHub Profile
@joshuaogle
joshuaogle / components.mount-icon.js
Last active October 24, 2019 18:03
Structure Tree View
import Ember from 'ember';
import EmberObject, { computed } from '@ember/object';
export default Ember.Component.extend({
isAWS: computed("icon", function() {
return this.get("icon") == "aws";
}),
isGCP: computed("icon", function() {
return this.get("icon") == "gcp";
})
import Ember from 'ember';
export default Ember.Component.extend({
selectedOption: null,
actions: {
setSelection: function(selected) {
this.set('selectedOption', selected)
console.log(this.get('selectedOption'))
},
submit: function(){
.sticky-top {
@include position(fixed, $base-spacing null null);
}
.sticky-bottom {
top: auto;
}
module ApplicationHelper
def body_class
"#{controller_name} #{controller_name}-#{controller.action_name} #{page_id}"
end
def controller_name
controller.controller_path.gsub('/','-')
end
def page_id
<div class="input-group">
<input type="checkbox" id="inputID" class="action-checkbox">
<label for="inputID">Label</label>
</div>
#
# Initialize the stuff
#
# We build the status bar item menu
def setupMenu
menu = NSMenu.new
menu.initWithTitle 'FooApp'
mi = NSMenuItem.new
mi.title = 'Hellow from MacRuby!'
mi.action = 'sayHello:'
@joshuaogle
joshuaogle / animated.js
Created December 8, 2014 16:47
Animate elements on scroll down
// Needs jQuery and jquery-visible (https://github.com/customd/jquery-visible)
$ ->
if $(".services").length > 0
animate_services_icon = ->
$(".services-list .image").each (i, el) ->
$el = $(el)
if $el.visible(true, true)
$el.addClass("animated")
@joshuaogle
joshuaogle / svg_fallback.js
Last active August 29, 2015 14:10
Vanilla JS fallback for SVG
svg_fallback = (function(){
var supportsSVG = document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image", "1.1");
var body = document.querySelector('body');
var images = document.querySelectorAll("[data-png-fallback]");
if (!supportsSVG) {
body.className += " no-svg";
[].forEach.call(images, function(image) {
image.src = image.getAttribute("data-svg-fallback");
});
@joshuaogle
joshuaogle / animate.css.scss
Created October 7, 2014 16:50
Animate on scroll
# Requires BourbonJS
@include keyframes(reveal) {
0% {
@include transform(translateY(em(30)));
opacity: 0;
}
100% {
@include transform(translateY(0));
@joshuaogle
joshuaogle / user_decorator.rb
Created April 29, 2014 15:23
Rails full_address decorator
def full_address
address_1 = join_present([address_line_1, address_line_2], ', ')
address_2 = join_present([city, state], ', ')
address_2 = join_present([address_2, zip], ' ')
join_present([address_1, address_2, country], '<br>')
end