Skip to content

Instantly share code, notes, and snippets.

View cm0s's full-sized avatar

Nicolas Forney cm0s

  • University of Geneva
  • Switzerland
View GitHub Profile
@macanderson
macanderson / CSS Prefixer
Created August 1, 2013 03:15
Python script to prefix all class and javascript files for bootstrap (version 3 supported)
#!/usr/bin/env python
from __future__ import print_function
import sys, re
import os.path
""" The CSS classname/namespace prefix to prepend to all Bootstrap CSS classes """
CSS_CLASS_PREFIX = 'ns-'
# Not all CSS classes that are referenced in JavaScript are actually defined in the CSS script.
@Kmaschta
Kmaschta / pre-commit
Last active November 16, 2022 19:35
Pre-commit hook (warn if you have it.only, describe.only, fit or fdescribe)
#!/bin/bash
SRC=$(git rev-parse --show-toplevel)
EXCLUDE="--exclude-dir 'node_modules' --exclude-dir '.git'"
#==========================================================
# Check if I forgot to remove 'only' keyword from tests.
# To make sure that before commit run all tests
only_command="grep -c -h -r $EXCLUDE -E \"(describe|it)\.only\" $SRC | awk -F ':' '{x +=\$0}; END {print x}'"
fonly_command="grep -c -h -r $EXCLUDE -E \"f(it|describe)\(\" $SRC | awk -F ':' '{x +=\$0}; END {print x}'"
only=`eval $only_command`
@Voles
Voles / .gitlab-ci.yml
Created February 2, 2017 20:20
GitLab configuration for Protractor
image: kkarczmarczyk/node-yarn:6.9
cache:
paths:
- webapp/node_modules/
- vendor/apt
e2e_tests:
before_script:
# install chrome
@fgeller
fgeller / prepare-commit-msg
Created March 21, 2017 01:20
prefixes commit message with path of changed files. useful in mono-repo setup
#!/bin/sh
prefixes=$(git diff --cached --name-only | while read f ; do echo "${f%/*}" ; done | sort | uniq)
prefixes_count=$(echo $prefixes | wc -l)
if [ "$prefixes_count" -eq "1" ]; then
sed -i "1s;^;$prefixes: \n;" "$1"
fi