Skip to content

Instantly share code, notes, and snippets.

View greenbicycle's full-sized avatar
🐈
maintaining a state of cat-like awareness

Jeff Davis greenbicycle

🐈
maintaining a state of cat-like awareness
  • University of Arizona
  • Tucson, AZ
View GitHub Profile
@greenbicycle
greenbicycle / php8.3-cli.sh
Created August 30, 2024 16:29
Run a specific version of php
#!/bin/bash
# usage: php8.3-cli.sh <command>
CONTAINER=php:8.3-alpine
docker run -it --rm --name php83 \
-v "$PWD":/code \
-v ~/.composer:/root/.composer \
-v ~/bin:/usr/local/sbin \
-w /code \
@greenbicycle
greenbicycle / Dockerfile
Last active October 17, 2022 22:34
Sample Ubuntu Dockerfile
#
# Ubuntu with Apache and PHP7.4
#
#FROM ubuntu:latest
FROM ubuntu/apache2
RUN apt-get update && apt-get upgrade -y
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=America/Phoenix
@greenbicycle
greenbicycle / gist:d933d54e960ce3b173836846d98c263c
Created February 23, 2022 17:55
Pretty output for Docker ps
alias dps = 'docker ps --format "table 👾 {{.Names}} \t {{.Status}} \t {{.Image}}"'

Things I have to remember about PHPStorm

Note: I use PHPStorm a particular way and so some of the standard settings make no sense at all. I am making note of some of the things that I have to remember about PHPStorm so I don't go crazy.

Tab limit

Editor > General > Editor Tabs

  • Set tab limit to 1

This is so that when you close a window, it actually closes the window. Otherwise you have to close the window

@greenbicycle
greenbicycle / certbot-install-ubuntu-1804
Created May 1, 2020 09:52
Install certbot on ubuntu 18.04
# Check certbot.eff.org to see if this is still correct
apt-get update
apt-get install software-properties-common -y
add-apt-repository universe
add-apt-repository ppa:certbot/certbot
apt-get update
apt-get install certbot python3-certbot-nginx
@greenbicycle
greenbicycle / ruby-install
Last active July 31, 2020 02:43 — forked from soardex/gist:e95cdc230d1ac5b824b3
Install ruby in Centos 7 with rbenv
# Adapted from this gist
# https://gist.github.com/soardex/e95cdc230d1ac5b824b3
# I changed .bash_profile to .bashrc since docker opens bash as non-login shell
# Also, I added 'gem update --system' because bundler was complaining about it
RUBY_VERSION=2.3.0
# install build dependencies
sudo yum install -y git-core zlib zlib-devel gcc-c++ patch readline readline-devel \
libyaml-devel libffi-devel openssl-devel make bzip2 \
@greenbicycle
greenbicycle / 20-browscap.ini
Created May 1, 2019 15:50
browscap ini file for /etc/php.d/
[browscap]
; http://php.net/browscap
browscap = /etc/browscap.ini
@greenbicycle
greenbicycle / hosts
Created March 25, 2019 23:28
ansible host for localhost
all:
hosts:
local:
ansible_host: 127.0.0.1
ansible_connection: local
@greenbicycle
greenbicycle / GradeFileImporter.php
Last active April 3, 2019 19:14
GradeFileImporter
<?php
/**
* Entrada [ http://www.entrada-project.org ]
*
* Entrada is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
@greenbicycle
greenbicycle / formattedDate.js
Created February 21, 2019 21:56
javascript date formatting unix timestamp
/* format a unixtimestamp as a javascript date
function formattedDate(unixTimestamp) {
let createdAtDateUTC = new Date(unixTimestamp * 1000);
let results = new Date(
createdAtDateUTC.getFullYear(),
createdAtDateUTC.getMonth(),
createdAtDateUTC.getDate(),
createdAtDateUTC.getHours(),
createdAtDateUTC.getMinutes(),
);