Skip to content

Instantly share code, notes, and snippets.

View chmanie's full-sized avatar
🦦

Christian Maniewski chmanie

🦦
View GitHub Profile
@chmanie
chmanie / hapi_1395.js
Created February 9, 2014 10:59
hapi issue #1395
{ domain: null,
_events: {},
_maxListeners: 10,
statusCode: 302,
headers: { 'content-type': 'text/html' },
variety: 'plain',
app: {},
plugins: {},
settings:
{ encoding: 'utf8',
@chmanie
chmanie / yar_25.js
Last active August 29, 2015 13:56
yar_25
'use strict';
var expect = require('expect.js');
var Hapi = require('hapi');
var server = Hapi.createServer('0.0.0.0', 8080, {
debug: {
request: ['error']
}
});
@chmanie
chmanie / parseGermanDate.js
Created March 18, 2014 22:35
Parser for german date format
function parseGermanDate(val) {
var parsed = val.match(/^(\d{1,2})\.\s?(\d{1,2}).\s?(\d{2,4})$/);
if (parsed) {
var year = (parsed[3].length === 2) ? parseInt('20' + parsed[3], 10) : parseInt(parsed[3], 10);
var month = parseInt(parsed[2], 10) - 1;
var day = parseInt(parsed[1]);
return new Date(year, month, day);
}
return;
}
function mergeDate(date, time) {
return new Date(date.getFullYear(), date.getMonth(), date.getDate(), time.getHours(), time.getMinutes(), time.getSeconds());
}
gulp.task('less_local', function () {
gulp.src(SRC_DIR + '/app/**/*.less')
.pipe(concat('bundle.less'))
.pipe(less({
paths: LESS_PATHS
}))
.on('error', notify.onError(function (error) {
return 'Error(s) in less files: ' + error.message;
}))
.pipe(gulp.dest(DIST_LOCAL_DIR + '/css'));
@chmanie
chmanie / vim_plugins.md
Last active August 29, 2015 14:05
Collection of great vim plugins
@chmanie
chmanie / .vimrc
Created September 2, 2014 07:31
My .vimrc
" pathogen
execute pathogen#infect()
" syntax highlighting
syntax on
filetype plugin indent on
" font settings
set guifont=Source\ Code\ Pro\ for\ Powerline:h16
" line numbers
set number
" colorscheme
Info: Loading facts
Info: Loading facts
Warning: Config file /etc/puppet/hiera.yaml not found, using Hiera defaults
Notice: Compiled catalog for openshift in environment production in 3.65 seconds
Warning: The package type's allow_virtual parameter will be changing its default value from false to true in a future release. If you do not want to allow virtual packages, please explicitly set allow_virtual to false.
(at /usr/lib/ruby/site_ruby/1.8/puppet/type/package.rb:430:in `default')
Info: Applying configuration version '1410105816'
Notice: /Stage[first]/Openshift_origin::Yum_install_method/Package[yum-plugin-priorities]/ensure: created
Notice: /Stage[first]/Openshift_origin::Yum_install_method/Yumrepo[openshift-origin]/ensure: created
Info: changing mode of /etc/yum.repos.d/openshift-origin.repo from 600 to 644
Global Gear Settings
+-------------------------+----------------------+
| Valid Gear Sizes | small, medium, large |
| User Default Gear Sizes | small, medium |
| Default Gear Size | small |
+-------------------------+----------------------+
Account Settings
+----------------------------+------------------------+
| OpenShift Console User | demo |
@chmanie
chmanie / gist:a24ee561fed415a0fd87
Created September 8, 2014 09:00
CSS rules for the last child and the next-to-last child but only when total child number is even
.my-class:last-child {
// stuff
}
.my-class:nth-last-child(2):nth-child(odd) {
// same stuff as above
}