Skip to content

Instantly share code, notes, and snippets.

View jgatjens's full-sized avatar
🏠
working from home!

Jairo Gätjens jgatjens

🏠
working from home!
View GitHub Profile
#!bash
#
# bash/zsh completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
#!bash
#
# git-flow-completion
# ===================
#
# Bash completion support for [git-flow](http://github.com/nvie/gitflow)
#
# The contained completion routines provide support for completing:
#
# * git-flow init and version
@jgatjens
jgatjens / server.js
Created September 22, 2014 02:13
server.js
'use strict';
var gulp = require('gulp');
var browserSync = require('browser-sync');
var httpProxy = require('http-proxy');
/* This configuration allow you to configure browser sync to proxy your backend */
var proxyTarget = 'http://server/context/'; // The location of your backend
var proxyApiPrefix = 'api'; // The element in the URL which differentiate between API request and static file request
@jgatjens
jgatjens / watchers.js
Created October 4, 2014 20:53
Angular total watchers
(function() {
var root = $(document.getElementsByTagName('body'));
var watchers = [];
var f = function(element) {
if (element.data().hasOwnProperty('$scope')) {
angular.forEach(element.data().$scope.$$watchers, function(watcher) {
watchers.push(watcher);
});
}
angular.forEach(element.children(), function(childElement) {
@jgatjens
jgatjens / hook_xhr.js
Last active August 29, 2015 14:11
hook XHR object
// Modified XMLHttpRequest to add a listener for start and stop the progress bar
//
// Save the real open
var oldOpen = XMLHttpRequest.prototype.open;
function onStateChange() {
// fires on every readystatechange ever
// use `this` to determine which XHR object fired the change event
if (this.readyState === 1) {
@jgatjens
jgatjens / .htaccess
Last active August 29, 2015 14:17 — forked from ScottPhillips/.htaccess
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@jgatjens
jgatjens / config.json
Created March 21, 2015 16:05
Sublime Config
{
"caret_extra_bottom": 3,
"caret_extra_top": 3,
"caret_extra_width": 2,
"font_size": 13,
"highlight_line": true,
"ignored_packages":
[
"Vintage"
],
{
"bold_folder_labels": true,
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
"font_face": "Source Code Pro",
"font_options":
[
"gray_antialias"
],
"font_size": 14,
"highlight_line": true,
@jgatjens
jgatjens / core-icons.scss
Last active August 29, 2015 14:25
Decimal to hexadecimal - font icon map loop
// ----
// libsass (v3.2.5)
// ----
@function dec-to-hex($d) {
$hexVals: "A" "B" "C" "D" "E" "F";
$base: 16;
$quotient: $d;
$result: "";
@if $d == 0 {
@jgatjens
jgatjens / db.js
Created July 23, 2015 16:42
Books Backend
{
"books": [
{
"id": 1,
"title": "Programming Ruby 1.9 & 2.0",
"author": "Dave Thomas",
"description": "Ruby is the fastest growing and most exciting dynamic language out there. If you need to get working programs delivered fast, you should add Ruby to your toolbox. ",
"img_url": "http://ecx.images-amazon.com/images/I/41gtODXuRlL._SX404_BO1,204,203,200_.jpg",
"user": {
"id": 1,