Skip to content

Instantly share code, notes, and snippets.

View amessinger's full-sized avatar
🐠

Antonin Messinger amessinger

🐠
  • Ponton 17
  • Paris, France
View GitHub Profile
@amessinger
amessinger / container-image.yml
Created May 4, 2022 12:18
Build and Push image with SSH support (for private git repositories for instance)
# make sure you have SSH_PRIVATE_KEY defined in your Github's repository (or organization) secrets
name: Container image
on:
push:
branches: [ main ]
jobs:
build-and-push:
runs-on: ubuntu-latest
@amessinger
amessinger / container-image.yml
Created April 22, 2022 16:08
Github Action Workflow to build and push an image to both GH and Scaleway registries
name: Container image
on:
push:
branches: [ main ]
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
name: Container image
on:
push:
branches: [ master ]
jobs:
build-push:
runs-on: ubuntu-latest
steps:
import { tracked } from '@glimmer/tracking';
import Component from '@ember/component';
import { action, computed, observer } from '@ember/object';
export default class extends Component {
updateActiveItem = observer('activeItems', function() {
console.log('updateActiveItem');
this.isActive = this.activeItems.includes(this.item);
})
import Component from '@glimmer/component';
import { action } from '@ember/object';
export default class extends Component {
get isActive() {
const { item, options: { activeItem } } = this.args;
return item === activeItem;
}
@action
setActive(event) {
@amessinger
amessinger / initiative.yaml
Created January 29, 2019 14:25
initiative openapi desc
openapi: 3.0.0
# Added by API Auto Mocking Plugin
servers:
- description: SwaggerHub API Auto Mocking
url: https://virtserver.swaggerhub.com/traquenard/initiative/1.0.0
info:
description: This is a the api for the initiative project
version: "1.0.0"
title: Initiative API
contact:
@amessinger
amessinger / cors.md
Created January 29, 2019 10:42
CORS
  • Audience: developers
  • Target: explain a web concept
  • Preliminary knowledge: HTTP

CORS

Disclaimer

This article is one among thousands; definitely not the most in depth; it just tries to lay down how its author got to work with CORS and not against (aka wildcarding all the things).

@amessinger
amessinger / prepare-commit-msg.sh
Last active September 7, 2018 16:28 — forked from bartoszmajsak/prepare-commit-msg.sh
Automatically generate git commit message from the branch name (angular convention)
#!/bin/bash
# Assesses your branch naming follow Angular's commit message format (https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#commits)
# Global Setup
# - create a `~/.git/hooks` folder
# - create the `prepare-commit-msg` hook file in this folder and paste this script
# - make git use this folder `git config --global core.hooksPath ~/.git/hooks`
# - allow for emtpy commit message `git config --global alias.commit "commit --allow-empty"`
@amessinger
amessinger / gist:b8eaa8d405c39b391694df56856e71f7
Created September 4, 2018 17:43
mount linux img partitions on macos
brew install ext4fuse
brew cask install osxfuse
diskutil list
# example: disk2s3 is the partion you wish to mount
sudo ext4fuse /dev/disk2s3 /Volumes/foo -o allow_other
open /Volumes/foo
@amessinger
amessinger / debounce.js
Created November 22, 2017 15:50
Debounce wrapper
function debounce(func, wait) {
let timeout;
return function(...args) {
clearTimeout(timeout);
timeout = setTimeout(()=> {
func.apply(this, args);
}, wait);
};
}