Skip to content

Instantly share code, notes, and snippets.

View salimchami's full-sized avatar
🏠
Working from home

Salim Chami salimchami

🏠
Working from home
View GitHub Profile
@salimchami
salimchami / gist:ad21d681ecc611da7d2db8f411f7910c
Last active November 22, 2022 20:43
Objects Collections Diff in Java
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.function.Function;
import static java.util.function.Function.identity;
import static java.util.stream.Collectors.toMap;
import static java.util.stream.Collectors.toSet;
@salimchami
salimchami / docker-cleanup-resources.md
Created June 24, 2019 14:05 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@salimchami
salimchami / mongodb-install.sh
Created January 23, 2018 16:11 — forked from chappy84/mongodb-install.sh
Install MongoDB from source on Fedora/RedHat based Linux with SystemD
#!/bin/sh
# MongoDB Version
MONGODB_VER='2.2.2'
# Get all the dependencies up to date
yum -y update
yum -y install scons gcc-c++ glibc-devel
# Get the source
@salimchami
salimchami / add_intellij_launcher
Last active August 23, 2016 21:03 — forked from rob-murray/add_intellij_launcer
Add Intellij launcher shortcut and icon for ubuntu
// create file:
sudo vim /usr/share/applications/intellij.desktop
// add the following
[Desktop Entry]
Version=13.0
Type=Application
Terminal=false
Icon[en_US]=/home/rob/.intellij-13/bin/idea.png
Name[en_US]=IntelliJ
@salimchami
salimchami / gist:04a1e30888bbdc64c468
Created March 10, 2016 17:09 — forked from Mithrandir0x/gist:3639232
Difference between Service, Factory and Provider in AngularJS
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"