Skip to content

Instantly share code, notes, and snippets.

View benfavre's full-sized avatar
💻
At the office

Webdesign29 benfavre

💻
At the office
View GitHub Profile
@benfavre
benfavre / Makefile
Created February 27, 2017 00:26 — forked from f440/Makefile
Makefile for docker project
NS ?= $(shell whoami)
REPO ?= $(shell basename $(shell pwd))
VERSION ?= latest
CONTAINER = $(NS)-$(REPO)
.PHONY: build
build:
docker build -t $(NS)/$(REPO):$(VERSION) .
@benfavre
benfavre / fosscoc.html
Created August 6, 2017 21:00 — forked from Swader/fosscoc.html
An anonymous response to dangerous FOSS Codes of Conduct
<h1>An anonymous response to dangerous FOSS Codes of Conduct</h1>
<p>Hello. I'm a professional web developer, but you can't verify that by looking at this page. I'm afraid to post this content under my real name because I'm around people who would try to get me fired from a job I love, or worse. Still, I need to get something off my chest in a space I control.</p>
<p>I've been in web development for nearly seven of the ten years that I've been barking orders at silicon, and the undisciplined chaos in the web development community is enough to make me question my career choice. It's not code that bothers me, its people who confuse innovation with fashion, and opinions with infrastructure.</p>
<p>Religious wars in software used to be about a fat bearded man named He-macs wrestling a pencil-neck named Vimmy over what text editor to use, but now FOSS devs are concerned about making sure marginalized human beings feel &ldquo;welcome,&rdquo; as if someone was trying to physically block newcomers. That opens the doo
@benfavre
benfavre / drush_admin_create
Created September 22, 2017 15:03 — forked from ecorson/drush_admin_create
Add admin user via Drush
drush user-create adminuser --mail="adminuser@uiowa.edu" --password="UserPw"; drush user-add-role "administrator" adminuser
@benfavre
benfavre / PinchZoomPan.js
Created February 17, 2018 22:53 — forked from iammerrick/PinchZoomPan.js
React Pinch + Zoom + Pan
import React from 'react';
const MIN_SCALE = 1;
const MAX_SCALE = 4;
const SETTLE_RANGE = 0.001;
const ADDITIONAL_LIMIT = 0.2;
const DOUBLE_TAP_THRESHOLD = 300;
const ANIMATION_SPEED = 0.04;
const RESET_ANIMATION_SPEED = 0.08;
const INITIAL_X = 0;
# Install brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install composer
brew install homebrew/php/composer
### PHPCS
composer global require "squizlabs/php_codesniffer=*"
# Add to your .bash_profile
# Update & Upgrade the System
sudo apt-get update
sudo apt-get upgrade
# Install dependencies there might be more based on your system
# However below instructions are for the fresh Ubuntu install/server
# Please carefully watch the logs because if something could not be install
# You have to make sure it is installed properly by trying the command or that particular
# dependency again
@benfavre
benfavre / git-pull-all
Created June 28, 2018 16:11 — forked from grimzy/git-pull-all
Git pull all remote branches
#!/usr/bin/env bash
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
git fetch --all
git pull --all
@benfavre
benfavre / PanZoom.js
Created March 9, 2020 00:31 — forked from companje/PanZoom.js
Pan / Zoom P5.js
//Zoom/Pan Component
//by Rick Companje, Nov 1, 2018.
//Enjoy!
var img;
var w, h, tow, toh;
var x, y, tox, toy;
var zoom = .01; //zoom step per mouse tick
function preload() {
@benfavre
benfavre / sftp-ubuntu.md
Created March 9, 2020 12:55 — forked from lymanlai/sftp-ubuntu.md
Basic tutorial for creating a SFTP-only user on Ubuntu 9.04 and greater

Adding SFTP-only user to Ubuntu Server

To add a SFTP-only user, you'll need to make sure your SSH config settings are correct, add a new user/group and set permissions for your new user. For step-by-step directions, see below. Omit sudo if you're logged in as root.

Directions

  1. Edit /etc/ssh/sshd_config and make sure to add the following at the end of the file:

     Match group filetransfer
    

ChrootDirectory %h