Skip to content

Instantly share code, notes, and snippets.

View briancaffey's full-sized avatar
🧘‍♂️

briancaffey briancaffey

🧘‍♂️
View GitHub Profile
@kevindice
kevindice / react-app-s3-sync.sh
Created January 27, 2019 02:19
A shell script for uploading a React app build to S3 + CloudFront for deployment
#!/bin/bash
S3_BUCKET_NAME=$1
CF_ID=$2
# Sync all files except for service-worker and index
echo "Uploading files to $S3_BUCKET_NAME..."
aws s3 sync build s3://$S3_BUCKET_NAME/ \
--acl public-read \
--exclude service-worker.js \
#All the environment variables are defined under Settings > CI/CD > Secret Variables section
image: docker:latest
variables:
DOCKER_DRIVER: overlay2
services:
- docker:dind
stages:
- build_dev
@alexellis
alexellis / README.md
Last active July 29, 2021 18:09
Provision a Raspberry Pi SD card

You'll need

  • Raspberry Pi 3, 3+ or 2 (only)
  • A Linux PC, laptop or Raspberry with SD card reader/slot
  • A number of Raspberry Pis configured with Ethernet

You must have an SSH key, if you don't know what this is then type in ssh-keygen and follow the instructions.

Prepare to provision RPis:

@BretFisher
BretFisher / docker-compose.yml
Created November 10, 2017 18:13
Docker Compose local development with wildcard DNS for multi-domain development
version: '3'
# vcap.me is a wildcard domain that resolves to localhost
# in case you need to pass URL's around from browser to
# containers this could help you get around localhost problem
services:
# use www.vcap.me to access web containter from host
# use api.vcap.me to access api container from host
proxy:
@languanghao
languanghao / left-bar.vue
Created December 22, 2016 06:56
element ui menu with vue-router
<template>
<el-menu :router="true" :default-active="activeLink">
<template v-for="rule in $router.options.routes">
<el-submenu v-if="rule.children && rule.children.length > 0"
:index="rule.path"
>
<template slot="title"><i :class="rule.icon"></i>{{ rule.title }}</template>
<el-menu-item v-for="child in rule.children" :index="rule.path + '/' + child.path">{{ child.title }}</el-menu-item>
</el-submenu>
<el-menu-item v-else
@cansadadeserfeliz
cansadadeserfeliz / admin.py
Last active May 13, 2020 14:00
Django: how to remove delete action/button from admin
class MyAdmin(admin.ModelAdmin):
def has_delete_permission(self, request, obj=None):
return False
def get_actions(self, request):
actions = super(MyAdmin, self).get_actions(request)
if 'delete_selected' in actions:
del actions['delete_selected']
return actions