Skip to content

Instantly share code, notes, and snippets.

View gubi's full-sized avatar

Alessandro Gubitosi gubi

View GitHub Profile
@gubi
gubi / Atom_packages.md
Last active May 13, 2022 13:20
Packages installed in Atom

Featured

  • Autocomplete
  • Autocomplete Plus
  • Zen
  • Color Picker
  • Linter
  • Linter Php
  • Linter csslint
  • Linter Jshint
  • Linter Jsonlint
{
paging: {
step: 50,
total: 3,
},
table: {
params: {
description_tooltip: "true",
filter_addon: "false",
paging_buttons: {
@gubi
gubi / search_count_result.json
Created May 20, 2014 07:59
First PGRDG search
{
"status": {
"state": "ok"
},
"paging": {
"affected": 9,
"actual": 9,
"skipped": 0,
"limit": 50
},
@gubi
gubi / calculate_altitude.js
Created March 30, 2014 13:23
Earth tools
$.get("http://www.earthtools.org/height/" + LATITUDE + "/" + LONGITUDE, function(heightdata) {
var xml = heightdata,
xmlDoc = $.parseXML(xml),
$xml = $(xmlDoc),
$height_mt = $xml.find("meters"),
$height_ft = $xml.find("feet");
console.log("Metri: " + $height_mt.text(), "Piedi: " + $height_ft.text());
});
@gubi
gubi / menuhead.html.twig
Last active August 29, 2015 13:57
Temp backup of enhanced menu with bootstrap dropdown (path: /Library/WebServer/Sites/pgrdg.grinfo.net/app/Resources/views)
<style>
.menu_level{float: right; width: 100%; list-style: none; background-color: #1E1E1E; padding: 5px; margin: 0px;}
.menu_level li {/*float: left; background-color: #1E1E1E;*/ margin-left: 10px;}
.menu_level li a{text-decoration: none; color: #fff; font-weight: bold; padding: 5px;}
#menu_opener{width: 100%; text-align: right; border-top: 2px solid #1E1E1E; color: #fff; cursor: pointer;}
#menu_opener span{ background-color: #1E1E1E; padding: 5px 20px;}
#menu_opener span:hover{ background-color: #1a1a1a;}
#menu a { padding: 5px; }
#menu li.menu_desc { padding: 5px 5px 5px 0; }
<?php
function explodeTree($array, $delimiter = "_", $baseval = false) {
if(!is_array($array)) return false;
$splitRE = "/" . preg_quote($delimiter, "/") . "/";
$returnArr = array();
foreach ($array as $key => $val) {
// Get parent parts and the current leaf
$parts = preg_split($splitRE, $key, -1, PREG_SPLIT_NO_EMPTY);
$leafPart = array_pop($parts);
<!-- Begin -->
<?php
$menu_name = 'primary';
$locations = get_nav_menu_locations();
$menu = wp_get_nav_menu_object($locations[$menu_name]);
$menuitems = wp_get_nav_menu_items($menu->term_id, array('order' => 'DESC'));
?>
<?php
$count = 0;
categories: {
"Technology",
"Finance",
"Justice",
"Culture",
"Art",
"Education",
"Science",
"Nature",
"Live",
@gubi
gubi / fa-bounce.css
Last active February 21, 2025 14:02
Pulse animation for FontAwesome icons
.fa-bounce {
display: inline-block;
position: relative;
-moz-animation: bounce 1s infinite linear;
-o-animation: bounce 1s infinite linear;
-webkit-animation: bounce 1s infinite linear;
animation: bounce 1s infinite linear;
}
@-webkit-keyframes bounce {
<?php
/**
* Explode any single-dimensional array into a full blown tree structure,
* based on the delimiters found in it's keys.
*
* The following code block can be utilized by PEAR's Testing_DocTest
* <code>
* // Input //
* $key_files = array(
* "/etc/php5" => "/etc/php5",