Skip to content

Instantly share code, notes, and snippets.

View arturmamedov's full-sized avatar
💭
Sul pezzo

Artur arturmamedov

💭
Sul pezzo
View GitHub Profile
@arturmamedov
arturmamedov / gist:882184747abdbe64b6c2
Created June 25, 2015 21:43
Scroll Collapse and Fix
/* Scroll and collapse box on view-pages of item */
var st = 51;
function updatePersistBox() {
$(".persist-area").each(function() {
var el = $(this),
offset = el.offset(),
scrollTop = $(window).scrollTop() + st,
floatingBox = $(".floatingBox", this)
// && (scrollTop < offset.top + el.height())
http://www.php.net/manual/en/function.timezone-identifiers-list.php
<?php
// here we are in to a script php how send the variable with array to smarty
$zones = timezone_identifiers_list();
foreach ($zones as $zone)
{
$zoneExploded = explode('/', $zone); // 0 => Continent, 1 => City
@arturmamedov
arturmamedov / update-message-at-time.js
Created May 4, 2016 22:43
Update Messages on page at predefined time
function updateMessage (){
// Message and time here. Use GMT Time (est +4)
var messages = [
['09/30/2014 21:10 GMT','Backstage: Next up Text here - @ 10 AM'],
['09/30/2014 21:12 GMT','Its 5:15'],
['09/30/2014 21:20 GMT','Its 5:20'],
['09/30/2014 21:25 GMT','Its 5:25'],
['09/30/2014 21:30 GMT','Its 5:30'],
['09/30/2014 21:35 GMT','Its 5:35'],
['09/30/2014 21:40 GMT','Its 5:40']
{"status": "ok", "items": [{"can_delete_comments": true, "code": "BGblVpbMyQkwm9MIUTWkdt9NCAuA37E28zSfi80", "location": null, "images": {"low_resolution": {"url": "https://scontent-mxp1-1.cdninstagram.com/t51.2885-15/s320x320/e15/13414404_1189485784417346_573008309_n.jpg?ig_cache_key=MTI2ODc3MTkzNTM0NDYwMDEwMA%3D%3D.2", "width": 320, "height": 320}, "thumbnail": {"url": "https://scontent-mxp1-1.cdninstagram.com/t51.2885-15/s150x150/e15/13414404_1189485784417346_573008309_n.jpg?ig_cache_key=MTI2ODc3MTkzNTM0NDYwMDEwMA%3D%3D.2", "width": 150, "height": 150}, "standard_resolution": {"url": "https://scontent-mxp1-1.cdninstagram.com/t51.2885-15/e15/13414404_1189485784417346_573008309_n.jpg?ig_cache_key=MTI2ODc3MTkzNTM0NDYwMDEwMA%3D%3D.2", "width": 612, "height": 612}}, "can_view_comments": true, "comments": {"count": 0, "data": []}, "alt_media_url": null, "caption": {"created_time": "1465469422", "text": "#putanesca puttana che esca", "from": {"username": "imartur", "profile_picture": "https://scontent-mxp1-1.cdnin
@arturmamedov
arturmamedov / withEqualHeight.html
Last active February 3, 2017 11:39
Equl Height for elements
<script>
/**
* Boxes AutoHeight
*
* @param columns
*
* data-weh-add="50" add 50px to all
*/
function withEqualHeight(columns) {
var tallestcolumn = 0, add = parseInt(columns.first().attr('data-weh-add'));
@arturmamedov
arturmamedov / css_cursor_table
Created September 9, 2016 12:49
CSS cursor values Table
<table class="data myne_kol" style="width:450px">
<caption>
Tabella dei Cursori CSS
</caption>
<tbody><tr>
<th>Cursore</th>
<th>Valore CSS</th>
<th>Esempio</th>
</tr>
@arturmamedov
arturmamedov / git-tag-delete-local-and-remote.sh
Created September 27, 2017 10:49 — forked from mobilemind/git-tag-delete-local-and-remote.sh
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@arturmamedov
arturmamedov / BSIT-gMaps.html
Last active November 15, 2017 17:42
gMaps - Implementations
<!--
https://developers.google.com/maps/documentation/javascript/examples/infowindow-simple#try-it-yourself
http://hpneo.github.io/gmaps/
-->
<script src="//maps.google.com/maps/api/js?sensor=true" type="text/javascript"></script>
<script src="/bower_components/gmaps/gmaps.js" type="text/javascript"></script>
<script type="text/javascript">
/** GOOGLE MAPS **/
INSPIRO.maps = function () {
@arturmamedov
arturmamedov / laravel_excel_to_db.php
Last active January 26, 2018 18:37
install `laravel`, install `maatwebsite/excel` and import data from excel to db table
<?php
// #1 - Install laravel: https://laravel.com/docs/5.5#installation
/* $console/bash/cmd commands >
$> composer global require "laravel/installer"
$> laravel new excel_to_db_project
$> cd excel_to_db_project
// #2 - Install excel package, documentation on: https://github.com/Maatwebsite/Laravel-Excel if laravel >5.5 no need to do nothing
$> composer require "maatwebsite/excel"
*/
@arturmamedov
arturmamedov / laravel_db_to_excel.php
Created February 14, 2018 08:57
Select Eloqeunt models, filter it and transfrom for export in xls with custom format to
<?php
// refer for this gist for first steps that are trhe same: https://gist.github.com/arturmamedov/0b2e5b7e39c7e1de8fc09f69f79db618
$parent_id = '1';
// select all children sites
$sites = Site::where('parent_id', $parent_id)->get();
//dd($sites);
$children_id = $sites->pluck('id');
//dd($children_id);