Skip to content

Instantly share code, notes, and snippets.

View ammarnajjar's full-sized avatar

Ammar Najjar ammarnajjar

View GitHub Profile
@ammarnajjar
ammarnajjar / .pre-commit-config.yml
Last active October 23, 2019 06:54
A collection of pre-commit hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: trailing-whitespace
- id: check-merge-conflict
- id: end-of-file-fixer
- id: mixed-line-ending
- id: check-docstring-first
- id: check-json
@ammarnajjar
ammarnajjar / rm_duplicates.sh
Created September 17, 2019 11:22
remove duplicates from PATH
# remove duplicates from PATH
# order in reverse as well
export PATH=$(echo -n $PATH | awk -v RS=: '{print}' | sort -r | awk '!($0 in a) {a[$0]; printf("%s%s", length(a) > 1 ? ":" : "", $0)}')
@ammarnajjar
ammarnajjar / main-args.py
Last active March 14, 2019 06:41
fetch-gitlab-using-api
#!/usr/local/bin/python3.7
"""
Clone/fetch projects from Gitlab using the private token
"""
import argparse
from os import path
import json
import subprocess
import shlex
customObservable({
next: val => console.log(val),
error: err => console.error(err),
complete: () => console.log('Completed')
});
@ammarnajjar
ammarnajjar / WebdriverGenerators.ipynb
Created April 9, 2017 13:04
Custom selenium webdrivers using decorators (ipython notebook)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ammarnajjar
ammarnajjar / WebdriverGenerators.py
Last active April 8, 2017 10:57
Generate custom selenium webdrivers
'''
Copyright (c) 2017 Ammar Najjar <[email protected]>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
#!/bin/bash
roslaunch schunk_lwa4p robot.launch
rosservice call /arm/driver/init
# success: True
# message: ''
roslaunch lwa4p_movit_config moveit_planning_execution.launch
@ammarnajjar
ammarnajjar / kinect2.sh
Created August 8, 2016 10:34
setup iai_kinect2 with GeForce GTX 750 Ti
# VGA compatible controller: NVIDIA Corporation GM107 [GeForce GTX 750 Ti]
function get_sudo() {
uid="$(id -u)"
SUDO="sudo"
if [[ $uid -eq 0 ]]
then
SUDO=""
fi
}
# This file is NOT licensed under the GPLv3, which is the license for the rest
# of YouCompleteMe.
#
# Here's the license text for this file:
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
#!/bin/bash
# File: watchit.sh
# Author: Ammar Najjar <[email protected]>
# Description: watches for a file changes and react to that change
# Last Modified: July 05, 2016
function usage() {
echo "watches for a file changes and react to that change"
echo