Skip to content

Instantly share code, notes, and snippets.

@bartimaeus
bartimaeus / PKGBUILD
Created September 28, 2021 23:35
Build the latest commit of https://github.com/TylerBrock/saw
# Maintainer: Tyler Brock <tyler.brock@gmail.com>
pkgname=saw
pkgver=b37c70de306768a0d54e5b97e46690b1f99cf1d0
pkgrel=1
pkgdesc="Fast, multipurpose tool for AWS CloudWatch Logs"
arch=('i686' 'x86_64' 'armv6h' 'armv7h')
provides=('saw')
url="https://github.com/TylerBrock/$pkgname"
license=('MIT')
makedepends=('go' 'git')
@bartimaeus
bartimaeus / .drone.yml
Created September 12, 2019 06:02
Example drone.io config for gatsby deploy to s3 and CloudFront
---
kind: pipeline
name: www [staging]
steps:
- name: build
image: node
environment:
GATSBY_GOOGLE_ANALYTICS_ID:
from_secret: staging_www_analytics_id
@bartimaeus
bartimaeus / start-docker.sh
Created February 6, 2019 19:57
Command used with tmuxinator to ensure that docker is running before starting the session
#!/bin/bash
# Open Docker, only if Docker not running
if (! docker ps -q 2>/dev/null ); then
# On Mac OS this would be the terminal command to launch Docker
open /Applications/Docker.app
echo "~> Starting Docker..."
echo ""
# Wait until Docker daemon is running and has completed initialisation
@bartimaeus
bartimaeus / git-sync.sh
Created February 6, 2019 19:04
Bash function to sync git repository. I use this when automatically pulling changes from many repositories so that I don't have to open each repo and determine if it's dirty or clean.
# Determine if we need to stash or not when updating git repository
function git-sync {
untracked=$(expr `git status --procelain 2>/dev/null | grep "^??" | wc -l`)
if [ "$untracked" = "0" ]; then
git pull --rebase
else
git stash
git pull --rebase
git stash apply
fi
@bartimaeus
bartimaeus / App.js
Created August 16, 2018 03:20
Lesson 05
////////////////////////////////////////////////////////////////////////////////
// Exercise:
//
// - Refactor App by creating a new component named `<GeoPosition>`
// - <GeoPosition> should use a render prop callback that passes
// the coords and error
// - When you're done, <App> should no longer have anything but
// a render method
// - Now create a <GeoAddress> component that also uses a render
// prop callback with the current address. You will use
@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";
@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 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 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
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