Skip to content

Instantly share code, notes, and snippets.

View noherczeg's full-sized avatar

Norbert Csaba Herczeg noherczeg

View GitHub Profile
/**
* @param {*} class Class of instance
* @param {*} root Data holder instance
* @param {*} relationName name of Meta relation, gets mapped to e.g. Single, List
*/
SomeService.prototype.fetchRecursive = function (clazz, root, relationName) {
let vm = this;
let deferred = this.$q.defer();
let service = this.$injector.get(clazz.serviceInstanceId());
let relation = clazz.getAttributeByName(relationName);
#!/bin/bash
branch=$1
echo "--------------------------------"
echo "Moving to branch: ${branch}"
echo "--------------------------------"
git fetch
git checkout $branch
@noherczeg
noherczeg / prep-repo
Created January 10, 2017 00:04
npm repository centralizer
#!/bin/bash
node_version="$(node -v)"
target=$HOME/.node_modules/$node_version
if [[ ! -d $target ]]; then
echo "Creating local central repo at: $target"
mkdir -p $target;
else
echo "Using central local repo at: $target"
# dnf config-manager --add-repo=http://negativo17.org/repos/fedora-spotify.repo
# dnf install spotify-client
sudo nano /etc/bumblebee/bumblebee.conf
# set Driver=nvidia from nouveau
sudo systemctl restart bumblebeed
optirun glxgears
# if this runs then drivers are fine
# DOTA2 config
dota 2 run options:
# download source https://www.python.org/downloads/release/python-2712/
wget https://www.python.org/ftp/python/2.7.12/Python-2.7.12.tgz
tar -zxvf Python-2.7.12.tgz
cd Python-2.7.12
# install
./configure
make
sudo make install
# this clears the full history, use with causion!
history -c
history -w
# update mirror list
sudo pacman-mirrors -i -c all
# update repos
sudo pacman -Syy
# install packages
pacman -S package_name1 package_name2 ...
/console scriptErrors 0
@noherczeg
noherczeg / bash_prompt.sh
Created June 28, 2016 19:25
custom bash prompt based on vagrant/bash_prompt.sh
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the active virtualenv
# * the branch/status of the current git repository
# * the return value of the previous command
# * the fact you just came from Windows and are used to having newlines in
# your prompts.