Skip to content

Instantly share code, notes, and snippets.

View egel's full-sized avatar

Maciej Sypien egel

View GitHub Profile
@egel
egel / colors.py
Created October 10, 2015 08:04
Simple python color class
#!/usr/bin/python3
# -*- coding: utf-8 -*-
class Colors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
@egel
egel / pre-commit
Last active March 20, 2017 09:48
Block to commit if user's email not match
#!/bin/sh
#
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# To enable this hook, rename this file to "pre-commit".
WHITE_LIST=''
@egel
egel / pre-push
Last active July 6, 2016 16:49
Git pre-push guardian to prevent push to protected branches.
#!/bin/bash
# General colors
black='\x1B[0;30m'
red='\x1B[0;31m'
green='\x1B[0;32m' # '\e[1;32m' is too bright for white bg.
blue='\x1B[1;34m'
yellow='\x1B[0;33m'
purple='\x1B[1;35m'
cyan='\x1B[0;36m'
@egel
egel / insert_csv_data_to_mysql.sh
Created April 11, 2016 08:29
Simple script that help you to insert multiple csv data into MySQL database table
#!/bin/bash
read -r -p "Type MySQL user (root): " USER
if [ -z "$USER" ]; then
USER=root
fi
read -r -p "Type MySQL $USER password: " PASS
read -r -p "Type MySQL database name: " DBNAME
read -r -p "Type MySQL database table: " DBTABLE
@egel
egel / angular-lodash.js
Created March 4, 2016 11:29
angular-lodash provider
'use strict';
function _lodashProvider() {
return {
$get: function($window) {
function _getLodash() {
return $window._
}
return {
@egel
egel / include.html
Created March 4, 2016 10:00 — forked from pmanijak/include.html
Minimal template example with AngularJS
:-)
@egel
egel / index.html
Created March 3, 2016 11:20
Minimal angular example with ui.router
<!doctype html>
<html ng-app="project">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.0/angular.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.2.18/angular-ui-router.min.js"></script>
<script src="scripts.js"></script>
</head>
@egel
egel / README.md
Created February 21, 2016 01:10 — forked from jimothyGator/README.md
Nginx configuration for Mac OS X with Homebrew, using sites-enabled directory.
mkdir -p /usr/local/etc/nginx/sites-{enabled,available}
cd /usr/local/etc/nginx/sites-enabled
ln -s ../sites-available/default.conf
ln -s ../sites-available/default-ssl.conf

File locations:

  • nginx.conf to /usr/local/etc/nginx/
  • default.conf and default-ssl.conf to /usr/local/etc/nginx/sites-available
  • homebrew.mxcl.nginx.plist to /Library/LaunchDaemons/
@egel
egel / button_inverse_mixins.sass
Created October 18, 2015 14:17
Helper mixins for building sass
@mixin button-inverse-variant($color, $hover-color, $hover-background, $border, $hover-border)
color: $color
background-color: transparent
border-color: $border
&:hover,
&:focus,
&.focus,
&:active,
&.active,
@egel
egel / funny-frogs.sh
Created October 10, 2015 09:39
Funny frogs installer - when run it adds to your .bashrc funny frogs daily phrase.
#!/bin/bash
green='\e[1;32m' # '\e[1;32m' is too bright for white bg.
red='\e[0;31m'
yellow='\e[0;33m'
purple='\e[0;35m'
endColor='\e[0m'
echo -e "${purple}====== Install: cowsay, fortune-mod ======${endColor}"
sudo apt-get install -y cowsay fortune-mod