Skip to content

Instantly share code, notes, and snippets.

View AnasMostefaoui's full-sized avatar

Mostefaoui Mohamed Anes AnasMostefaoui

View GitHub Profile
@AnasMostefaoui
AnasMostefaoui / Yii2_eb_ext.config
Created April 18, 2020 08:08 — forked from hemc4/Yii2_eb_ext.config
Yii2 Elastic Beanstalk configration for advance template
commands:
01cacheClear:
command: rm -rf ~/.composer
02updateComposer:
command: export COMPOSER_HOME=/root && /usr/bin/composer.phar self-update 1.0.0-alpha11
03globalrequired:
command: export COMPOSER_HOME=/root && /usr/bin/composer.phar global require fxp/composer-asset-plugin:1.1.3
@AnasMostefaoui
AnasMostefaoui / introrx.md
Created August 24, 2019 20:36 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing

Using Swift Package Manager with iOS

Step 1:

File > New > Project...

Step 2:

Create a Package.swift file in your root project directory, add dependencies, then run swift package fetch on the command line in the same directory. We’re not going to run swift build because it will just complain.

@AnasMostefaoui
AnasMostefaoui / Theming-Slack-OSX.md
Created November 11, 2018 11:08 — forked from DrewML/Theming-Slack-OSX.md
Theming Slack for OSX

Theming Slack for OSX

So, you love Slack, but you hate applications with large white backgrounds? Why not use Dark Mode!

Unfortunately, Slack does not have a Dark Mode, although it's on their list of possibilities.

But, don't fret - there is a solution! Because the slack native desktop apps are just wrappers around a web app, we can inject our own CSS to customize the application to our liking.

How to (OSX Only)

@AnasMostefaoui
AnasMostefaoui / drush_cs.sh
Created July 5, 2018 09:17 — forked from Paulmicha/drush_cs.sh
Drush - usual commands cheatsheet
#!/bin/bash
# -*- coding: UTF8 -*-
##
# Drush usual commands cheat sheet
# Prerequisites : drush installed
#
# Sources:
# http://drushcommands.com/
# http://highrockmedia.com/blog/features-drush-drupal-goodness
@AnasMostefaoui
AnasMostefaoui / Matrix.md
Created May 24, 2018 18:50 — forked from nadavrot/Matrix.md
Efficient matrix multiplication

High-Performance Matrix Multiplication

This is a short post that explains how to write a high-performance matrix multiplication program on modern processors. In this tutorial I will use a single core of the Skylake-client CPU with AVX2, but the principles in this post also apply to other processors with different instruction sets (such as AVX512).

Intro

Matrix multiplication is a mathematical operation that defines the product of

import com.squareup.moshi.*
import java.lang.reflect.ParameterizedType
import java.lang.reflect.Type
object PairAdapterFactory : JsonAdapter.Factory {
override fun create(type: Type, annotations: MutableSet<out Annotation>, moshi: Moshi): JsonAdapter<*>? {
if (type !is ParameterizedType) {
@AnasMostefaoui
AnasMostefaoui / Laravel-Container.md
Created February 6, 2018 09:27
Laravel's Dependency Injection Container in Depth

Laravel's Dependency Injection Container in Depth

Laravel has a powerful Inversion of Control (IoC) / Dependency Injection (DI) Container. Unfortunately the official documentation doesn't cover all of the available functionality, so I decided to experiment with it and document it for myself. The following is based on Laravel 5.4.26 - other versions may vary.

Introduction to Dependency Injection

I won't attempt to explain the principles behind DI / IoC here - if you're not familiar with them you might want to read What is Dependency Injection? by Fabien Potencier (creator of the Symfony framework).

Accessing the Container

alias deploy="git pull origin master && composer install && php artisan cache:clear && php artisan config:clear && php artisan debugbar:clear && php artisan route:clear && php artisan view:clear && sudo chmod 777 -R storage/ && php artisan config:cache && php artisan route:cache"
alias a='axel -a -n 8'
alias dt='axel -a -o ~/Downloads/test "http://speed.hetzner.de/1GB.bin"'
alias dtr='rm ~/Downloads/test*'
alias c='cd ~/www'
alias ll='ls -al'
alias ch='sudo chmod -R 777 .'
alias chweb='sudo chown -R kossa:http . && sudo find . -type d -exec chmod 755 {} + && sudo find . -type f -exec chmod 644 {} +'
alias g='guard'
@AnasMostefaoui
AnasMostefaoui / xcode-build-bump.sh
Created August 27, 2017 12:10 — forked from sekati/xcode-build-bump.sh
Xcode Auto-increment Build & Version Numbers
# xcode-build-bump.sh
# @desc Auto-increment the build number every time the project is run.
# @usage
# 1. Select: your Target in Xcode
# 2. Select: Build Phases Tab
# 3. Select: Add Build Phase -> Add Run Script
# 4. Paste code below in to new "Run Script" section
# 5. Drag the "Run Script" below "Link Binaries With Libraries"
# 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0)