Skip to content

Instantly share code, notes, and snippets.

View monobasic's full-sized avatar

André Abt monobasic

View GitHub Profile
nzz.init.base(Y, {
publication: 'nzz',
platform: 'desktop',
databaseSize: 5242880,
date: '2012/05/10',
activeMenuItem: 'front'
});
if (nzz.history) {
nzz.history.addHistory('Front - NZZ Webpaper', 'http://nzz.lo/app_dev.php/2012/05/10/front/', '2012/05/10', 'front');
<?php
function cmp($a, $b) {
$sortOrder = array(
'3/0', '2/0', '1/0', '1', '2', '3'
);
$sortOrderPositionA = array_shift(array_keys($sortOrder, $a['name']));
$sortOrderPositionB = array_shift(array_keys($sortOrder, $b['name']));
<?php
function cmp($a, $b) {
$sortOrder = array(
'3/0', '2/0', '1/0', '1', '2', '3'
);
$sortOrderPositionA = array_values(array_keys($sortOrder, $a['name']));
$sortOrderPositionB = array_values(array_keys($sortOrder, $b['name']));
@monobasic
monobasic / jQuery Validation Auto Rules
Created November 27, 2012 12:59
Auto generate jQuery Validation Rules for all Elements of a Form
// ouput all available form field names to console (copy paste it from there for a standard validation rules config object)
$.fn.generateDefaultValidationRules = function() {
var allFields = [];
var validationRulesString = '';
var allInputs = donationform.find(':input');
allInputs.each(function(index, element) {
var fieldName = $(element).attr('name');
if (jQuery.inArray(fieldName, allFields) === -1 && $(element).attr('type') !== 'hidden' && fieldName !== undefined) {
allFields.push(fieldName);
validationRulesString += fieldName + ': \'required\',\r\n';
{
"workbench.colorTheme": "Nord",
"editor.fontFamily": "Hack",
"editor.fontSize": 14,
"terminal.integrated.fontFamily": "Hack",
"terminal.integrated.fontSize": 12,
"workbench.startupEditor": "newUntitledFile",
"files.trimTrailingWhitespace": true,
"emmet.includeLanguages": {
"vue-html": "html",