Skip to content

Instantly share code, notes, and snippets.

@bartimaeus
bartimaeus / gist:3935419
Created October 22, 2012 23:21 — forked from dougwaldron/gist:1151942
More Chrome Inspector CSS
/* Additional styles for Chrome Inspector; should be used with
http://darcyclarke.me/design/skin-your-chrome-inspector/
and
http://dpaste.com/hold/595890/
*/
#elements-content li.hovered:not(.selected) .selection {
/* hover color */
background: rgba(255, 255, 255, .2) !important;
}
#elements-content .selection.selected {
@bartimaeus
bartimaeus / update-dns.rb
Created November 8, 2012 17:59
Updated Route53 Record When EC2 Instance Starts
# /home/ubuntu/bin/update-dns.rb
require 'rubygems'
require 'open-uri'
require 'route53'
zone = "bartimae.us"
record_type = "A"
ip_address = open("http://169.254.169.254/latest/meta-data/public-ipv4") { |f| f.read }
@bartimaeus
bartimaeus / update-dns.rb
Created November 13, 2012 06:45
Script to Update Route53 with an EC2 Instance IP Address
# /home/ubuntu/bin/update-dns.rb
require 'rubygems'
require 'open-uri'
require 'route53'
zone = "bartimae.us"
record_type = "A"
ip_address = open("http://169.254.169.254/latest/meta-data/public-ipv4") { |f| f.read }
@bartimaeus
bartimaeus / update-dns.sh
Created November 13, 2012 06:47
Init script to run local dns update script for Route53
#!/bin/bash
su - ubuntu -c "ruby $HOME/bin/update-dns.rb"
@bartimaeus
bartimaeus / posts_controller.rb
Created August 7, 2013 15:14
Thanks sheeny! here is the final working solution with your help
...
def posts_params
params[:post][:tags] = params[:post][:tags].split(",") if params[:post][:tags].is_a? String
params.require(:post).permit(:title, :content, :tags => [])
end
end
class Api::ApplicationController < ActionController::Metal
include ActionView::Layouts
include ActionController::Helpers
include ActionController::Rescue
include ActionController::Redirecting
include AbstractController::Rendering
include ActionController::Renderers::All
include ActionController::ImplicitRender
include ActionController::MimeResponds
include ActionController::ConditionalGet
@bartimaeus
bartimaeus / App.js
Last active August 15, 2018 17:34
Lesson 02
import "./index.css";
import React, { Component } from "react";
import FaPlay from "react-icons/lib/fa/play";
import FaPause from "react-icons/lib/fa/pause";
import FaForward from "react-icons/lib/fa/forward";
import FaBackward from "react-icons/lib/fa/backward";
class RadioGroup extends Component {
state = {
value: null
@bartimaeus
bartimaeus / App.js
Created August 15, 2018 17:35
Lesson 01
import "./index.css";
import React, { Component } from "react";
import subscribeToMessages from "./messages";
import FadeIn from "./FadeIn";
// If user has scrolled up, don't scroll down
class PinScrollToBottom extends Component {
componentDidMount() {
// this.scrollToBottom();
@bartimaeus
bartimaeus / App.js
Last active August 16, 2018 07:41
Lesson 03
/*
- Make the Play button work
- Make the Pause button work
- Disable the play button if it's playing
- Disable the pause button if it's not playing
- Make the PlayPause button work
- Make the JumpForward button work
- Make the JumpBack button work
- Make the progress bar work
- change the width of the inner element to the percentage of the played track
@bartimaeus
bartimaeus / App.js
Created August 16, 2018 03:19
Lesson 04
/*
Create a `withStorage` higher order component that manages saving and retrieving
the `sidebarIsOpen` state to local storage
*/
import "./index.css";
import React from "react";
import MenuIcon from "react-icons/lib/md/menu";
import { set, get, subscribe } from "./local-storage";