Skip to content

Instantly share code, notes, and snippets.

View psi-4ward's full-sized avatar

Christoph Wiechert psi-4ward

View GitHub Profile
@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 / LoginController.js
Created January 12, 2015 16:09
Sails.JS JWT Auth
// controllers/LoginController.js
module.exports = {
index: function(req, res) {
var email = req.param('email');
var password = req.param('password');
// delay everthing to prevent bruteforce, dos and timing attacks
setTimeout(function() {
@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');
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'}))
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',
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');
@psi-4ward
psi-4ward / contao.conf
Last active October 19, 2016 10:44
NGINX Contao 3 Config with PHP-FPM
index index.php index.html index.html;
client_max_body_size 200M;
sendfile on;
error_page 404 /404.html;
location / {
try_files $uri $uri/ /index.php?$args;
}
location = /favicon.ico {
@psi-4ward
psi-4ward / Gruntfile.js
Created December 19, 2013 11:25
Grunt + LiveReload + LESS + Contao Be sure to have LiveReload Chrome Extension installed
var path = require('path');
// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to recursively match all subfolders:
// 'test/spec/**/*.js'
module.exports = function(grunt) {
var buildPath = 'build';
var srcPath = 'src';
var path = require('path');
// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to recursively match all subfolders:
// 'test/spec/**/*.js'
<?php
/**
* Initialize the system
*/
define('TL_MODE', 'FE');
require 'system/initialize.php';
$tl_filesIDs = array('3', '4', '5', '6');