Skip to content

Instantly share code, notes, and snippets.

💭
Sul pezzo

Artur arturmamedov

💭
Sul pezzo
Block or report user

Report or block arturmamedov

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@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"));
@arturmamedov
arturmamedov / bootstrap4-media-breakpoints.css
Created May 6, 2019 — 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
* up > sm, md, lg, xl
* down < sm, md, lg
* only = xs, sm, lg, xl
* between <> sm-lg, sm-xl, md-xl
*/
/* .xs = | Extra Small devices only (portrait phones) less than 576px */
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;
@arturmamedov
arturmamedov / laravel_log_daily_email_ip_conf.php
Last active Feb 1, 2019 — forked from reedmaniac/Laravel Logging - Customization
Laravel Logger configuration for Daily logs, Email send on Warning Level, and optionally (comment out and add on setFormatter()) HTML Formater
View laravel_log_daily_email_ip_conf.php
<?php
// Put at the top of ./config/app.php
// Custom Monolog Configuration - https://laravel.com/docs/5.2/errors#configuration
use Monolog\Logger;
use Monolog\Handler\StreamHandler;
use Illuminate\Mail\TransportManager;
$app->configureMonologUsing(function($monolog) use ($app) {
You can’t perform that action at this time.