Skip to content

Instantly share code, notes, and snippets.

View jbdelhommeau's full-sized avatar
🐙
Poulpe fiction

Jean-Baptiste Delhommeau jbdelhommeau

🐙
Poulpe fiction
View GitHub Profile
<?php
declare(strict_types=1);
<<<CONFIG
packages:
- "symfony/console": "^4.3"
- "symfony/finder: ^4.3"
- "symfony/filesystem: ^4.3"
- "symfony/yaml": "^4.3"
@chanmix51
chanmix51 / arrays_in_bash.md
Last active April 2, 2020 18:26
Using arrays in Bash

Using arrays in bash

creating an array

$> my_array=(one two three)

accessing/setting elements

$> echo ${my_array}

one

@apolloclark
apolloclark / postgres cheatsheet.md
Last active March 7, 2024 13:53
postgres cheatsheet

Postgres Cheatsheet

This is a collection of the most common commands I run while administering Postgres databases. The variables shown between the open and closed tags, "<" and ">", should be replaced with a name you choose. Postgres has multiple shortcut functions, starting with a forward slash, "". Any SQL command that is not a shortcut, must end with a semicolon, ";". You can use the keyboard UP and DOWN keys to scroll the history of previous commands you've run.

Setup

installation, Ubuntu

http://www.postgresql.org/download/linux/ubuntu/ https://help.ubuntu.com/community/PostgreSQL

# Before Script
before_script:
- composer self-update
- composer install --prefer-dist > /dev/null
- cp .env.example .env
- php artisan key:generate
- php artisan migrate:refresh
# Services
services:
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@mpalourdio
mpalourdio / php-cs-fixer
Created November 12, 2014 21:24
@fabpot php-cs-fixer config for PhpStorm
parameters
--level=psr2 --verbose fix $FileDir$/$FileName$
working directory
$ProjectFileDir$
@magnetikonline
magnetikonline / gittruncatehistory.sh
Last active February 27, 2020 22:29
Truncate Git history to after specific SHA1, dropping everything at and before it.
#!/bin/bash -e
# Inspired by: https://github.com/adrienthebo/git-tools/blob/master/git-truncate
if [[ (-z $1) || (-z $2) ]]; then
echo "Usage: $(basename "$0") DROP_AT_SHA1 BRANCH"
exit 1
fi
if [[ ! $1 =~ ^[0-9a-f]{7,40}$ ]]; then
echo "Error: invalid Git commit SHA1" >&2
@obscurerichard
obscurerichard / README.md
Created September 17, 2012 22:35
Simulates a low bandwidth, high-latency network connection

slow

This bash script offers quick shortcuts to simulate slower network connections. It is useful when you need to simulate a wireless network on a Linux network server, especially when you are using a virtual machine guest on your local machine or in the cloud.

slow 3G                   # Slow network on default eth0 down to 3G wireless speeds
slow reset                # Reset connection for default eth0 to normal
slow vsat --latency=500ms # Simulate satellite internet  with a high latency
slow dsl -b 1mbps         # Simulate DSL with a slower speed than the default

slow modem-56k -d eth0 # Simulate a 56k modem on the eth1 device. eth0 is unchanged.