Skip to content

Instantly share code, notes, and snippets.

View bm2ilabs's full-sized avatar
🎯
Focusing

Boukraa Mohamed bm2ilabs

🎯
Focusing
View GitHub Profile
@bm2ilabs
bm2ilabs / string-utils.js
Created February 14, 2019 19:21 — forked from jonlabelle/string-utils.js
Useful collection of JavaScript string utilities.
// String utils
//
// resources:
// -- mout, https://github.com/mout/mout/tree/master/src/string
/**
* "Safer" String.toLowerCase()
*/
function lowerCase(str){
return str.toLowerCase();
const merge = require('webpack-merge');
const VueLoaderPlugin = require('vue-loader/lib/plugin');
const ManifestPlugin = require('webpack-manifest-plugin');
const WebpackNotifierPlugin = require('webpack-notifier');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
const dotenv = require('dotenv');
const browsers = '>0.25%, > 5% in BE, not ie 11, not op_mini all';
module.exports = config => (env, argv) =>
@bm2ilabs
bm2ilabs / couponDigitalOcean2018.txt
Created October 5, 2018 12:03
Coupon 100$ For DigitalOcean [Valid on in October 2018]
DigitalOcean announce that will be giving 100$ credit valid for 60 days in October of 2018 valid for new consumers get your 100$ for free in
https://m.do.co/c/aad8573706cd
@bm2ilabs
bm2ilabs / v-cloak.md
Created April 10, 2018 14:39 — forked from adamwathan/v-cloak.md
Useful CSS utilities for Vue.js cloaking

Handy helpers for controlling visibility of elements until Vue has compiled.

Use like:

<div v-cloak>
  <h1>
    <span class="v-cloak--inline">Loading...</span> <!-- Only displayed before compiling -->
    <span class="v-cloak--hidden">{{ post.title }}</span> <!-- Hidden until compiling is finished -->
 
@bm2ilabs
bm2ilabs / vue-http-directive.js
Last active January 30, 2018 15:07
Prefix Http to the url if there is non
Vue.directive('http', {
// When the bound element is inserted into the DOM...
update: function (el) {
console.log(el.value)
// Focus the element
let value = el.value
if (el.value && !/^(http|https):\/\//i.test(value)
&& 'http://'.indexOf(value) === -1) {
el.value = 'http://' + value;
@bm2ilabs
bm2ilabs / gist:474527548ef1d2f54af4d193e5c0f3cf
Created June 15, 2017 22:07
EACCES: permission denied .config/configstore/bower-github.json [Solved]
sudo chown -R $USER:$GROUP ~/.npm
sudo chown -R $USER:$GROUP ~/.config
RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [F,NC]
@bm2ilabs
bm2ilabs / gist:617cab410f3cd93da777f1238bbc0349
Created April 29, 2017 17:53
Gulp watch error code: ENOSPC
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
@bm2ilabs
bm2ilabs / gist:2dd8ba65bf473286b910e9f4b0957583
Created April 22, 2017 18:02
Random string generator, Bash
cat /dev/random | tr -dc "[:alpha:]" | head -c 8
@bm2ilabs
bm2ilabs / gist:811f30fdd3a325143f486992649bd435
Created February 12, 2017 12:32
enospc gulp watch error fix
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p