Skip to content

Instantly share code, notes, and snippets.

View DavidBadura's full-sized avatar
:electron:
coding...

David Badura DavidBadura

:electron:
coding...
View GitHub Profile
@mjrider
mjrider / user-config.yml
Created March 10, 2018 19:21
user-config for hetzner cloud, to get a smaller root partition
#cloud-config
# do not reisze, we are going to do that our self. Because the resizefs will run before the disk setup
resize_rootfs: false
# setup disk, overwriting our live partition scheme
# results in a 4G/16GB split on a cx11
# overwrite needs to be true because we are going to change the layout of an existing drive
disk_setup:
/dev/sda:
@gregblass
gregblass / App.js
Last active September 21, 2019 17:30
Expo/React Navigation - Google Analytics Integration
import React, { Component } from 'react'
import { RootNavigator } from './navigators'
import { GoogleAnalyticsTracker } from './utils/analytics'
import { GA_TRACKING_ID } from './constants'
class App extends Component {
// gets the current screen from navigation state
getCurrentRouteName = (navigationState) => {
if (!navigationState) {
return null
@hikari-no-yume
hikari-no-yume / example.php
Created March 20, 2017 20:02
function chaining for PHP 7
<?php declare(strict_types=1);
require_once "✨.🐘";
✨($_)->strlen("foo")->var_dump($_);
@nknapp
nknapp / Dockerfile
Created October 30, 2016 20:15
Traefik setup as reverse-proxy with docker and letsencrypt
FROM traefik:camembert
ADD traefik.toml .
EXPOSE 80
EXPOSE 8080
EXPOSE 443
@HeahDude
HeahDude / MacroAutoloadTwigExtension.php
Last active March 23, 2018 22:54
MacroTwigExtension - Autoloading macro in templates for symfony 2.3+
<?php
// src/AppBundle/Twig/MacroTwigExtension.php
namespace AppBundle\Twig;
class MacroAutoloadTwigExtension extends \Twig_Extension
{
public function getFunctions()
{
access.format = "[%{%Y-%m-%dT%H:%M:%S%z}t] requestid:%{REQUEST_ID}e frontendip:%R frontendhost:%{SERVER_HOSTNAME}e host:%{HTTP_HOST}e clientip:%{REAL_IP}e https:%{HTTPS}e verb:%m response:%s fpm_pool:%n request:\"%{REQUEST_URI}e%Q%q\" script_filename:%f php_process_time:%{micro}d php_process_bytes:%{bytes}M php_cpu_user:%{user}C%% php_cpu_system:%{system}C%% php_cpu_total:%{total}C%%"
@paulirish
paulirish / bling.js
Last active May 1, 2024 19:56
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;
@leesmith
leesmith / simple-git-workflow.md
Last active December 30, 2023 23:37
Simple Git Workflow For Continuous Delivery

Simple Git Workflow For Continuous Delivery

Workflow guidelines:

  • master branch is always production-ready, deployable, 100% green test suite
  • New development is done on feature branches, with frequent rebasing onto master
  • Clean commit history by preferring to rebase instead of merge (git pull is configured to automatically rebase)

rebase workflow

Workflow

@h4cc
h4cc / satis_install.sh
Last active February 13, 2024 16:39
Guide to install a satis server for composer. It can mirror packages and create a index for own packages.
# Install a Webserver
apt-get -y install apache2
# Target docroot to /home/satis/web/
# Install PHP5 CLI and needed programs.
apt-get -y install php5-cli php5-curl php5-json git wget
# Add a specifix user for our task
adduser satis
@jbenet
jbenet / simple-git-branching-model.md
Last active June 17, 2024 14:53
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.