Skip to content

Instantly share code, notes, and snippets.

View psi-4ward's full-sized avatar

Christoph Wiechert psi-4ward

View GitHub Profile
var config = require('./gulp/config.js');
var commander = require('commander');
var gulp = require('gulp');
var runSequence = require('run-sequence');
var gutil = require('./node_modules/gulp/node_modules/gulp-util/index.js');
var del = require('del');
var glob = require('glob');
var open = require('open');
var config = {
src: __dirname + '/../src/',
dist: __dirname + '/../dist/',
buildTasks: ['jshint', 'app', 'libs', 'copy', 'less'],
buildTasksProd: ['minify-app', 'minify-libs'],
_watchers: []
};
config.libs = [
'bower_components/jquery/dist/jquery.js',
gulp.task('build-stylesheets', function () {
return gulp.src('sources/stylesheets/tenside.less')
.pipe(plumber())
.pipe(sourcemaps.init())
.pipe(less({compress: true}))
.pipe(autoprefixer({
browsers: ['last 2 versions'],
cascade: false
}))
.pipe(rename({suffix:'.min'}))
@psi-4ward
psi-4ward / j_hoverImg.html5
Last active August 29, 2015 14:12
Contao jQuery Template to change the a <img src="img.jpg"> to <img src="img_hover.jpg"> on mouseover
<script>
(function($) {
$(document).ready(function() {
var fadeDuration = 500;
$('.hover-img').each(function(i, el) {
el = $(el);
if(el.css('position') != 'absolute')
el.css('position', 'relative');
@psi-4ward
psi-4ward / nodemon.json
Created February 2, 2015 18:13
nodemon.json
{
"restartable": "rs",
"ignore": [
"packages/*/angular/",
"packages/*/gulpsi.json"
],
"verbose": false,
"watch": [
"packages/",
"server.js"
@psi-4ward
psi-4ward / README.md
Created April 14, 2015 15:30
CoreOS - Consul - Registrator
  • /opt/bin/etcdctl2 is a wrapper for etcdctl to add certs
  • copy the consul web-ui into /DATA/infra/consul/ui
#!/usr/bin/env bash
#############################################################
# Check the memory consumption of a running docker container
# by reading cgroup information
#
# Licence: LGPL
# Author: Christoph Wiechert <wio@psitrx.de>
#############################################################
@psi-4ward
psi-4ward / check_docker_cpu.sh
Created August 25, 2015 15:36
check_docker_cpu.sh
#!/usr/bin/env bash
#############################################################
# Check the cpu consumption of a running docker container
# by reading cgroup information
#
# Licence: LGPL
# Author: Christoph Wiechert <wio@psitrx.de>
#############################################################
@psi-4ward
psi-4ward / user.js
Created October 20, 2015 14:27
Loopback User model with *roles* property support
/**
* Loopback User model with *roles* property support
*/
var builtinUser = require('loopback/common/models/user.js');
var async = require('async');
var _ = require('lodash');
var debug = require('debug')('loopback:user');
@psi-4ward
psi-4ward / formidableGridFs.js
Created August 31, 2013 16:18
FormidableGridFS Handler
var IncomingForm = require('formidable');
var util = require('util');
var EventEmitter = require('events').EventEmitter;
var GridStore = require('mongodb').GridStore;
var pauseStream = require('pause-stream');
var ObjectID = require('mongodb').ObjectID;
function IncomingFormGridFS(opts) {
if(!(this instanceof IncomingFormGridFS)) return new IncomingFormGridFS(opts);
if(!opts.mongodbConnection) throw "Please provide mongodbConnection option!";