Skip to content

Instantly share code, notes, and snippets.

Avatar

Archakov Dennis Archakov06

View GitHub Profile
@Archakov06
Archakov06 / laravel.sh
Last active Nov 16, 2016
Composer laravel alias
View laravel.sh
composer global require "laravel/installer"
export PATH="~/.composer/vendor/bin:$PATH"
source ~/.bashrc
View validex directive for Angular.js
app.directive('validex', function(){
return {
require: 'ngModel',
link: function(scope, element, attrs, modelCtrl) {
modelCtrl.$parsers.push(function (val) {
if (!attrs.validex) return false;
var pattern = attrs.validex;
var flags = attrs.vflags ? attrs.vflags : '';
var exp = new RegExp(pattern,flags);
@Archakov06
Archakov06 / required_inputs.js
Last active Nov 16, 2016
Check all required inputs
View required_inputs.js
// if (!$('#fullname').val()) {
// $(this).addClass('error');
// return false;
// }
//
// if (!$('#email').val()) {
// $(this).addClass('error');
// return false;
// }
//
@Archakov06
Archakov06 / _reset.sass
Created Nov 18, 2016
Reset styles SASS
View _reset.sass
html, body, div, span, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
abbr, address, cite, code,
del, dfn, em, img, ins, kbd, q, samp,
small, strong, sub, sup, var,
b, i,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, figcaption, figure,
View add_friends_on_fb.js
document.querySelectorAll('.FriendRequestAdd').forEach(function(e){
e.click()
});
setTimeout(function(){
document.querySelectorAll('.layerCancel').forEach(function(e){
e.click()
});
}, 2000);
@Archakov06
Archakov06 / js-task-1.md
Created Feb 10, 2017 — forked from codedokode/js-task-1.md
Задания на яваскрипт (простые)
View js-task-1.md
View myfunction.js
$scope.getProblematics = function(callback) {
var url = $scope.makeAPI('/problematics');
$http.get(url, {
headers: {
"Content-Type": "application/json",
"Accept": "application/json",
"auth_token": $.cookie('auth_token')
}
View es6-sort-object.js
Object.keys(tags)
.sort((a, b) => tags[a] - tags[b])
.reverse()
.map((name, i) => ({ [name]: tags[name] }))
// before: {a: 3, b: 4, c: 2: d: 1}
// after: {b: 4, a: 3, c: 2, d: 1}
View server.js
// app.js
import express from 'express';
import bodyParser from 'body-parser';
import methodOverride from 'method-override';
import session from 'express-session';
import cookieParser from 'cookie-parser';
import errorHandler from 'errorhandler';
import morgan from 'morgan';
import flash from 'connect-flash';
View server.js
// config.js
const merge = require('lodash').merge;
const config = {
// Common configuration section
sentry: {
url: 'https://',
},
mongodbUri: 'mongodb://',
url: global.hasOwnProperty('location') ? global.location.origin + '/' : '',