Skip to content

Instantly share code, notes, and snippets.

@mateuszwrobel
mateuszwrobel / jquery.plugin_pattern.js
Last active June 17, 2023 13:41
jQuery: plugin pattern
/*
* Project:
* Description:
* Author:
* License:
*/
// the semi-colon before function invocation is a safety net against concatenated
// scripts and/or other plugins which may not be closed properly.
;(function ( $, window, document, undefined ) {
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { TRANSLOCO_SCOPE, TranslocoModule } from '@ngneat/transloco';
@NgModule({
imports: [
TranslocoModule,
],
declarations: [],
@mateuszwrobel
mateuszwrobel / azure-pipelines.yaml
Last active April 8, 2022 12:16
Branch naming policy guard with Azure Pipeline handling funtionality
- task: Bash@3
displayName: Branch name check
inputs:
filePath: '$(System.DefaultWorkingDirectory)/git-hooks/hooks/prepare-commit-msg'
@mateuszwrobel
mateuszwrobel / singleton.js
Created November 4, 2012 00:09
JS: patterns Singleton
var mySingleton = (function () {
// Instance stores a reference to the Singleton
var instance;
function init() {
// Singleton
// Private methods and variables
import * as $ from 'jquery';
import * as _ from 'underscore';
import moment from 'moment';
import alertify from 'alertify.js';
import NProgress from 'nprogress';
require('nprogress/nprogress.css');
require('./http.css');
import config from '../config';
{
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
"rules": {
"no-var": [0],
"comma-dangle": [1, "always-multiline"],
"no-console": [0],
"indent": [1, "tab", {
@mateuszwrobel
mateuszwrobel / index.html
Last active January 17, 2017 10:14
nodejs serve statics
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<link rel="stylesheet" href="/css/styles.css">
</head>
<body>
<h1>It Works!</h1>
<script src="/js/bundle.js"></script>
@mateuszwrobel
mateuszwrobel / gulp.js
Created September 9, 2016 13:36
browserify+react
var gulp = require('gulp');
var sass = require('gulp-sass');
var replace = require('gulp-replace');
var livereload = require('gulp-livereload');
var autoprefixer = require('gulp-autoprefixer');
var notify = require('gulp-notify');
var rename = require('gulp-rename');
var gutil = require('gulp-util');
var watchify = require('watchify');
export default {
// private property
_keyStr: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=',
// public method for encoding
encode: function(input) {
var output = '';
var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
var i = 0;
input = Base64._utf8_encode(input);