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 / 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 / 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 / Dockerfile
Created January 17, 2017 23:23 — forked from jmyrland/Dockerfile
Docker mounted volume removes node_modules
# Set the base image to stable version of node
FROM node:0.12.2
# Install nodemon
RUN npm install -g nodemon
# Provides cached layer for node_modules
COPY package.json /tmp/package.json
RUN cd /tmp && npm install --production
RUN mkdir -p /app && cp -a /tmp/node_modules /app/
@benfavre
benfavre / gen.sh
Created January 15, 2017 00:15 — forked from thomasyip/gen.sh
Generate self-signed alternate dns (wildcard) ssl certificate with a single script
#!/bin/bash
# file: gen.sh
# usage: ./gen.sh [name]
ROOT=rootCA
NAME=${1:-device}
EXTS=( key cnf csr crt )
ROOT_NAME=rootCA
ROOT_EXTS=( key pem )
@benfavre
benfavre / README.md
Created October 26, 2016 23:44 — forked from dbu/README.md
Convert NelmioApiDocBundle annotations to Swagger PHP

A Symfony command to convert from NelmioApiDocBundle annotations to Swagger-PHP annotations.

This code is provided as is. Make sure to have your code committed to version control before running the command. Check if things work out and if not, use version control to reset the automated changes and fix the command.

@benfavre
benfavre / -README.md
Created February 19, 2016 17:44 — forked from jirutka/-README.md
How to use terminal on Windows and don’t go crazy…

How to use terminal on Windows without going crazy…

Windows is really horrible system for developers and especially for devops. It doesn’t even have a usable terminal and shell, so working with command line is really pain in the ass. If you really don’t want to switch to any usable system (OS X, Linux, BSD…), then this guide should help you to setup somewhat reasonable environment – usable terminal, proper shell, ssh client, git and Sublime Text as a default editor for shell.

Install stuff

  1. Download and install Git for Windows* with:
    • [✘] Use Git from the Windows Command Prompt
  • [✘] Checkout as-is, commit Unix-style line endings
<?php
// Add custom meta to user profile screen
add_action( 'show_user_profile', 'example_show_extra_profile_fields' );
add_action( 'edit_user_profile', 'example_show_extra_profile_fields' );
function example_show_extra_profile_fields( $user ) { ?>
<h3>Payment information</h3>
/*
Allows for ajax requests to be run synchronously in a queue
Usage::
var queue = new $.AjaxQueue();
queue.add({
url: 'url',
@benfavre
benfavre / functions.php
Created April 22, 2013 18:36
Cleanup Shortcode #WordPress #functions.php
<?php
// A mettre dans functions.php
add_filter('the_content', 'clean_p_shortcode');
function clean_p_shortcode($content){
$array = array (
'<p>[' => '[',
']</p>' => ']',
']<br />' => ']'
);
@benfavre
benfavre / load_async.js
Last active December 16, 2015 05:39 — forked from ngryman/snippet.js
Load Javascript files asynchonously
/*
* Updated to use the function-based method described in http://www.phpied.com/social-button-bffs/
* Better handling of scripts without supplied ids.
*
* N.B. Be sure to include Google Analytics's _gaq and Facebook's fbAsyncInit prior to this function.
*/
(function(d, u) {
var s = d.scripts[0],
i = u.length, g;