Skip to content

Instantly share code, notes, and snippets.

define('$MODEULE_NAME$',function(require, exports){
var $NAME$ = require('$NAME$')
exports = $END$;
return exports;
})
@aliaksandr-master
aliaksandr-master / install.sh
Last active January 3, 2017 11:57
Reinstall Debian Jessie + KDE
# Linux x64 Debian Jessie + KDE
# nano
nano /etc/apt/sources.list
# add 'contrib non-free'
# disable src repos
# add new repos
apt-get install -y python-software-properties software-properties-common apt-transport-https
apt-add-repository 'deb http://manpages.ylsoftware.com/debian/ all main'
#!/usr/bin/env bash
DATE=`date +%Y-%m-%d--%H-%M-%S`
MAINDIR=`pwd`
THIS_SHELL_FILE_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
function simLink() {
local destFile=$1
@aliaksandr-master
aliaksandr-master / php_dump.php
Created March 24, 2015 09:43
fast function for dumping of vars with styling
<?php
function dump($var, $showFullData = false, $escapeTags = false, $cover = true){
if (!defined('DEBUG') || !DEBUG) {
return $var;
}
if (!defined('DUMP_WAS_ADDED')) {
define('DUMP_WAS_ADDED', true);
}
@aliaksandr-master
aliaksandr-master / .gitignore
Last active August 29, 2015 14:19
common gitignore for frontend projects
# ide and os files
.idea/
*.DS_Store
*.kate-swp
*.desktop
*.thumb
*.sublime*
.~*
~*
*~
@aliaksandr-master
aliaksandr-master / .travis.yaml
Created June 26, 2015 13:59
.travis.yaml for node lib
language: node_js
node_js:
- "stable"
- "unstable"
- "iojs"
before_script:
- npm i jscoverage coveralls grunt-cli nodeunit
script: "./node_modules/.bin/grunt test"
after_script:
- ./node_modules/.bin/jscoverage lib
@aliaksandr-master
aliaksandr-master / nginx.conf
Created November 18, 2015 09:41 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
'use strict';
var glob = require('glob');
var path = require('path');
var _ = require('lodash');
var fs = require('fs');
var chalk = require('chalk');
glob.sync(path.resolve(__dirname, 'app/components/**/*.js')).forEach(function (f) {
var content = fs.readFileSync(f, { encoding: 'utf8' });
class BaseModel {
constructor (data, options = {}) {
if (options.$parse == null || options.$parse) {
data = this.$parse(data, options);
}
this.$$data = _.cloneDeep(data);
_.extend(this, data);
@aliaksandr-master
aliaksandr-master / on-error-handler.js
Last active January 25, 2020 13:32
error notificator
window.onErrorNotice = function (func) {
'use strict';
var onerror = function(e) {
func({
title: e.title || 'JavaScript error',
message: e.error && e.error.name && 'number' in e.error ? e.error.name + ': ' + e.message : e.message,
file: (e.filename && e.filename.search(/^https?:|file:/) !== -1 ? e.filename + ':::' : '') + (e.filename ? e.filename + ':' + (e.lineno == null ? '' : e.lineno) + ':' + (e.colno == null ? '' : e.colno) : ''),
stack: (e.error && e.error.stack) || e.stack || ''
});