Last active
July 11, 2024 10:53
-
-
Save gubi/83402a9aae7cfa762df8 to your computer and use it in GitHub Desktop.
Revisions
-
gubi revised this gist
Feb 11, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -24,7 +24,7 @@ function array_delete($array, $element) { $icons_file = "css/font-awesome/css/font-awesome.css"; $parsed_file = file_get_contents($icons_file); preg_match_all("/fa\-([a-zA-z0-9\-]+[^\:\.\,\s])/", $parsed_file, $matches); $exclude_icons = array("fa-lg", "fa-2x", "fa-3x", "fa-4x", "fa-5x", "fa-ul", "fa-li", "fa-fw", "fa-border", "fa-pulse", "fa-rotate-90", "fa-rotate-180", "fa-rotate-270", "fa-spin", "fa-flip-horizontal", "fa-flip-vertical", "fa-stack", "fa-stack-1x", "fa-stack-2x", "fa-inverse"); $icons = (object) array("icons" => array_delete($matches[0], $exclude_icons)); print json_encode($icons); -
gubi revised this gist
Feb 11, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -24,7 +24,7 @@ function array_delete($array, $element) { $icons_file = "css/font-awesome/css/font-awesome.css"; $parsed_file = file_get_contents($icons_file); preg_match_all("/fa\-([a-zA-z0-9\-]+[^\:\.\,\s])/", $parsed_file, $matches); $exclude_icons = array("fa-lg", "fa-2x", "fa-3x", "fa-4x", "fa-5x", "fa-ul", "fa-li", "fa-fw", "fa-rotate-90", "fa-rotate-180", "fa-rotate-270", "fa-spin"); $icons = (object) array("icons" => array_delete($matches[0], $exclude_icons)); print json_encode($icons); -
gubi revised this gist
Feb 11, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,7 +9,7 @@ */ header("Content-type: text/json"); /** * Remove items from an array -
gubi revised this gist
Feb 11, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -25,7 +25,7 @@ function array_delete($array, $element) { $parsed_file = file_get_contents($icons_file); preg_match_all("/fa\-([a-zA-z0-9\-]+[^\:\.\,\s])/", $parsed_file, $matches); $exclude_icons = array("fa-lg", "fa-2x", "fa-3x", "fa-4x", "fa-5x", "fa-ul", "fa-li", "fa-fw"); $icons = (object) array("icons" => array_delete($matches[0], $exclude_icons)); print json_encode($icons); ?> -
gubi revised this gist
Feb 11, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ /** * Available Font Awesome icons * * Get all icons from a font-awesome.css file and list in json mode * * @author Alessandro Gubitosi <[email protected]> * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License, version 3 -
gubi revised this gist
Feb 11, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -21,7 +21,7 @@ function array_delete($array, $element) { return (is_array($element)) ? array_values(array_diff($array, $element)) : array_values(array_diff($array, array($element))); } $icons_file = "css/font-awesome/css/font-awesome.css"; $parsed_file = file_get_contents($icons_file); preg_match_all("/fa\-([a-zA-z0-9\-]+[^\:\.\,\s])/", $parsed_file, $matches); $exclude_icons = array("fa-lg", "fa-2x", "fa-3x", "fa-4x", "fa-5x", "fa-ul", "fa-li", "fa-fw"); -
gubi created this gist
Feb 11, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ <?php /** * Available Font Awesome icons * * Get all icons from a font-awesome.css file and returns it in a json list * * @author Alessandro Gubitosi <[email protected]> * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License, version 3 */ header("Content-type: text/plain"); /** * Remove items from an array * @param array $array The array to manage * @param void $element An array or a string of the item to remove * @return array The cleaned array with resetted keys */ function array_delete($array, $element) { return (is_array($element)) ? array_values(array_diff($array, $element)) : array_values(array_diff($array, array($element))); } $icons_file = "../../../css/font-awesome/css/font-awesome.css"; $parsed_file = file_get_contents($icons_file); preg_match_all("/fa\-([a-zA-z0-9\-]+[^\:\.\,\s])/", $parsed_file, $matches); $exclude_icons = array("fa-lg", "fa-2x", "fa-3x", "fa-4x", "fa-5x", "fa-ul", "fa-li", "fa-fw"); $icons = array_delete($matches[0], $exclude_icons); print json_encode($icons); ?>