Skip to content

Instantly share code, notes, and snippets.

View ludofleury's full-sized avatar
🐼
Yay

Ludovic Fleury ludofleury

🐼
Yay
View GitHub Profile
@ludofleury
ludofleury / magic.sh
Last active August 2, 2022 15:53
"automate my splitting of iterm windows and opening of docker-compose logs of my applications. You can use osascript to do that which will execute AppleScript" by Anne-Sophie (https://github.com/tanguy-a)
#!/bin/bash
osascript<<EOF
tell application "iTerm"
activate
select first window
# Create new tab
tell current window
create tab with default profile
<?php
use DateTimeImmutable;
use LogicException;
Class Marker
{
public function __construct(private string $title, private DateTimeImmutable $activatedAt = null) {}
public function activate(): void
@ludofleury
ludofleury / calculator.js
Last active March 25, 2021 01:22
Attribute & Method vs Variable & Function
//////////// Object oriented programming
console.log('Calculator:');
let calculator = {
// attribute "result" of calculator object
result: 0,
// method "add()" of calculator object
add: function (number) {
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
# If you come from bash you might have to change your $PATH.
export PATH=$HOME/bin:/usr/local/bin:$PATH:/Users/ludo/Library/Python/3.7/bin
# Path to your oh-my-zsh installation.
export ZSH="/Users/ludo/.oh-my-zsh"
ZSH_THEME="powerlevel9k/powerlevel9k"
# CASE_SENSITIVE="true"
# HYPHEN_INSENSITIVE="true"
@ludofleury
ludofleury / docker-compose.yml
Created October 31, 2018 17:24
Docker Compose shared host based named volume with ${PWD} variant for mac
version: "3.0"
services:
composer:
image: composer/composer
working_dir: /var/app
volumes:
- project:/var/app
- ./var/composer:/composer
volumes:
#!/bin/bash
# use newline as separator
IFS=$'\n'
for author in $(git log --all --format='%cN' | sort -u); do
echo $author;
git log --all --author="$author" --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "++ %s\n-- %s\n= %s\n", add, subs, loc }' -
done
@ludofleury
ludofleury / documented-endpoints
Created May 4, 2015 20:36
twitter RESt Public API inconsistencies
account/remove_profile_banner
account/settings
account/settings
account/update_delivery_device
account/update_profile
account/update_profile_background_image
account/update_profile_banner
account/update_profile_image
account/verify_credentials
application/rate_limit_status
vagrant plugin install vagrant-berkshelf --plugin-version 2.0.1 --verbose
Installing the 'vagrant-berkshelf --version '2.0.1'' plugin. This can take a few minutes...
Fetching source index from http://gems.hashicorp.com/
Fetching gem metadata from https://rubygems.org/.........
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
Using addressable (2.3.6)
Using multipart-post (2.0.0)
Using faraday (0.9.0)
Using berkshelf-api-client (1.2.0)
<?php
public function it_is_initializable()
{
$this->beConstructedWith('FR');
$this->shouldHaveType(Country::class);
}
public function its_constructor_requires_a_valid_country_isocode()
{