Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Sul pezzo

Artur arturmamedov

💭
Sul pezzo
View GitHub Profile
@arturmamedov
arturmamedov / w-global-tools.js
Last active Jul 28, 2020
Tools that change global behavior of website things, for not deal with a lot of changes for a little thing
View w-global-tools.js
/**
In example make all images of website content (maybe insterted trough editor)
openable trough gallery
[this work with Blueimp Gallery https://github.com/blueimp/Gallery]
*/
$(".auto-gallery-content").each(function(){
var data_gallery = $(this).data("autoGallery") ? $(this).data("autoGallery") : "gallery";
$("img", $(this)).each(function () {
if (!$(this).hasClass('no-auto-gallery')) {
@arturmamedov
arturmamedov / bootstrap4-media-breakpoints.css
Last active Jun 12, 2020 — forked from withArtur/bootstrap4-media-breakpoints.css
Bootstrap 4 all media query breakpoints (xs,sm,md,lg,xl) up to, down from, only
View bootstrap4-media-breakpoints.css
/**
* Bootstrap 4 all media queries #wMQ
* https://getbootstrap.com/docs/4.5/layout/overview/
* up > sm, md, lg, xl
* down < sm, md, lg
* only = xs, sm, lg, xl
* between <> sm-lg, sm-xl, md-xl
*/
@arturmamedov
arturmamedov / instagram_api.php
Created Jun 15, 2016
Instagram API retrive access token with PHP curl
View instagram_api.php
<?php
// yo can follow this guide to http://www.benrlodge.com/blog/post/how-to-generate-an-instagram-access-token#
#1 first you need to create a Client in Instgram Developer Dashboard
// https://www.instagram.com/developer/clients/manage/
#2 after you need to retrive a oAuth code for after get access_token
// https://www.instagram.com/developer/authentication/
// change the params with your one and open link in browser
@arturmamedov
arturmamedov / on_before_unload.js
Last active Jul 9, 2019
Window on before unload - for stop user to escape page before all data is not saved or an action not performed
View on_before_unload.js
// Message to be displayed on unload
var message = $('#jtrnslt #leavemess').text(), submitting = false;
// On Form submition set submitting to true for not fire onbeforeunload
$(document).on("submit", "form", function(event){
submitting = true;
});
// Window onbeforeunload fired when leave page but not if it a form submition or element with .noBeforeUnload class
window.onbeforeunload = function (e) {
e = e || window.event;
// Determine if you want to allow unload
@arturmamedov
arturmamedov / withAlert.js
Last active Jul 9, 2019
Show bootstrap 3/4 alerts like notifications or whatever you want simply by call `withAlert('message', 'type')`
View withAlert.js
/**
* withAlert()
*
* @dependencies [css: bootstrap(.alert), withstyle(.withAlert), jquery]
*
* @param string message
* @param string type warning|success|danger|primary|secondary|info
* @param object options {autohide: true/false, hidetime: 6000, placement: top|bottom}
*/
function withAlert(message, type, options) {
@arturmamedov
arturmamedov / w-whatsapp.js
Created May 16, 2019
WhatsApp Api on Mobile and Desktop
View w-whatsapp.js
/**
* Replace mobile URL of WhatsApp with Desktop
* The mobile first strategy is used cause most people decide to not show WhatsApp on Desktop but only on mobile where it is very useful
*
* @dependencies [ core/w-ismobile.js ]
*/
if(withOptions.whatsappWeb && !jQuery.browser.mobile && $(".whatsapp-weburl").length > 0){
clog('WhatsApp Enabled and Present');
clog($(".whatsapp-weburl"));
View traffic_sources_cookies.js
// configuration
var $hostname = '.sviluppo1.loc',
cookie_params = ['source', 'medium', 'campaign']; // there are also [... 'term', 'content'] !commented
function crumbleCookie(a) {
for (var d = document.cookie.split(";"), c = {}, b = 0; b < d.length; b++) {
var e = d[b].substring(0, d[b].indexOf("=")).trim(),
i = d[b].substring(d[b].indexOf("=") + 1, d[b].length).trim();
c[e] = i;
}
@arturmamedov
arturmamedov / AJS-jQ_showhide.html
Last active Apr 9, 2019
AngularJS show /hide VS jQuery show/hide.
View AJS-jQ_showhide.html
<!-- AngularJS ng-show and ng-click -->
<div class="checkbox">
<label ng-click="show = !show">
<input type="radio" name="cat_id" value="1">
<strong>Residenziale</strong> Immobili in vendita oppure in affitto<br>
</label>
<span ng-show="show">
<label class="checkbox-inline">
<input type="radio" value="A" name="res_sell_type">
@arturmamedov
arturmamedov / merge_options.php
Last active Feb 12, 2019
Merge $defaults with custom passed $options
View merge_options.php
<?php
/*
* spesso abbiamo bisogno di parametri default obbligatori
* ma che possono essere sovrascritti con quelli custom passati alla funzione ad ogni chiamata
* ... la suluzione in 4 righe e' questa
* ---
* [EN] often we need a mandatory options parameters that can be overriden by custom params passed each time
* the solution is here in 4 rows of code
*/
@arturmamedov
arturmamedov / am-bs.css
Last active Feb 1, 2019
My Custom Miscellaneous CSS style, bootstrap compattible
View am-bs.css
/* OVERWRITED */
.modal-footer {margin-top:0px;}
.center-block {
float:none;
}
/* Tables * /
.table-striped > thead > tr {
background-color: #D196A4;
You can’t perform that action at this time.