mysql --host=localhost --user=USERNAME_HERE --password PASSWORD_HERE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function (grunt) { | |
grunt.loadNpmTasks('grunt-contrib-uglify'); | |
grunt.loadNpmTasks('grunt-contrib-watch'); | |
grunt.loadNpmTasks('grunt-contrib-compass'); | |
grunt.initConfig({ | |
uglify: { | |
my_target: { | |
files: { | |
'_/js/script.js': ['_/components/js/*.js'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function ($) { | |
// @input `containerSelector` - String: a CSS selector which targets container of `<img>` element(s) you want to be replaced in case of error (mostly 404) | |
// @input `imagePath` - String: Absolute/Relative path to image file which would be shown (replaced) | |
window.handleBrokenImage = function (containerSelector, imagePath) { | |
if (!containerSelector) { | |
return false; | |
} | |
imagePath = imagePath || 'https://placeholdit.imgix.net/~text?txtsize=33&txt=webgodo&w=350&h=150'; |
Library URL: Click to open
Can be used to access currently initialized carousel and make it stop (if is playing around).
var owl = $('.carousel-element-selector');
owl.trigger('stop.owl.autoplay');
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// turn a string into a URL friendly serie of characters concatenated via '-' | |
export const slugify = (str) => str && typeof str === 'string' ? str | |
.toLowerCase() | |
// replace persian/arabic digits with numbers | |
.replace(/([٠١٢٣٤٥٦٧٨٩])|([۰۱۲۳۴۵۶۷۸۹])/g, (m, $1) => m.charCodeAt(0) - ($1 ? 1632 : 1776)) | |
// replace characters other than [a-z] [ا-ی], [0-9], [آ,ئ] with a dash (-) | |
.replace(/[^آئa-z0-9ا-ی]+/g, '-') | |
.replace(/^-|-$/g, '') | |
// limit the string to 100 characters | |
.slice(0, 100) : '' |
Login to the database (MySql) where the Drupal 7 is installed. Then run the following query on your database;
Update users set name='[email protected]', pass='$S$DD7aCRCy6iTddzIbeTPIVdwg4Ea9KgFqpSXZpGjMQtWBA8zzg24t' where uid=1;
Now login Drupal via the user with Username: [email protected], Password: 123456