Skip to content

Instantly share code, notes, and snippets.

View naffiq's full-sized avatar
🚩
Moving forward

Galymzhan Abdugalimov naffiq

🚩
Moving forward
View GitHub Profile
@naffiq
naffiq / .htaccess
Created April 9, 2018 07:53
.htaccess for Plesk Apache + FastCGI
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
@naffiq
naffiq / .babelrc
Created March 14, 2018 18:10
Babel config for Laravel react app
{
"presets": [
"env",
"stage-0",
"react"
],
"plugins": ["transform-object-rest-spread"]
}
@naffiq
naffiq / README.md
Last active October 10, 2021 15:10
Image min for Laravel Mix

Based on this comment.

npm install --save-dev imagemin-webpack-plugin copy-webpack-plugin imagemin-mozjpeg
const { mix } = require('laravel-mix');
const ImageminPlugin = require('imagemin-webpack-plugin').default;
const CopyWebpackPlugin = require('copy-webpack-plugin');
@naffiq
naffiq / adb-date.bash
Created September 21, 2017 11:56
Fix date on your Genymotion from Mac terminal
adb shell date -s "`date +%Y%m%d.%H%M%S`"
@naffiq
naffiq / rf-health.php
Created April 13, 2017 13:14
Monitoring server health status
<?php
/**
* @author naffiq <abdu.galymzhan@gmail.com>
*
* Copyright 2017 RocketFirm
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to the following conditions:
params={};location.search.replace(/[?&]+([^=&]+)=([^&]*)/gi,function(s,k,v){params[k]=v})
@naffiq
naffiq / console.js
Created October 4, 2016 10:35
Telegram Math battle win code
var answer = function()
{
var calc = function(x, y, op) {
x = parseFloat(x); y = parseFloat(y);
if (op == '+') return x + y;
if (op == '–') return x - y;
if (op == '×') return x * y;
if (op == '/') return x / y;
}
@naffiq
naffiq / add-text-on-copy.js
Last active May 13, 2016 09:38
Adds text to copied content from website
function addLink() {
//Get the selected text and append the extra info
var selection = window.getSelection(),
pagelink = '<br /><br /> Подробнее: ' + document.location.href
+ '. Любое использование материалов допускается только при наличии гиперссылки на azan.kz',
copytext = selection + pagelink,
newdiv = document.createElement('div');
//hide the newly created container
newdiv.style.position = 'absolute';
@naffiq
naffiq / php_extension_check.sh
Last active April 22, 2016 07:19
Check if php extension is installed
php -i | grep $1