Skip to content

Instantly share code, notes, and snippets.

View giovanniramos's full-sized avatar
🖥️
Work Work Work

Giovanni Ramos giovanniramos

🖥️
Work Work Work
View GitHub Profile
@giovanniramos
giovanniramos / OpenWithSublimeText3.bat
Last active July 17, 2018 19:53 — forked from mrchief/LICENSE.md
Add "Open with Sublime Text 3" to Windows Explorer Context Menu
@echo off
SET stPath=C:\Program Files\Sublime Text 3\sublime_text.exe
SET entryName=Open with Sublime Text 3
SET menuText=Open with Sublime Text 3
rem add it for all file types
@reg add "HKEY_CLASSES_ROOT\*\shell\%entryName%" /t REG_SZ /v "" /d "%menuText%" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\%entryName%" /t REG_EXPAND_SZ /v "Icon" /d "%stPath%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\%entryName%\command" /t REG_SZ /v "" /d "%stPath% \"%%1\"" /f
@giovanniramos
giovanniramos / full-code.js
Created October 11, 2017 21:58
AngularJS - How to Cancel / Abort all pending requests in angularJs
/** *************************************************
File: app.module.js
*/
(function () {
'use strict';
// Defining angularjs Module
var app = angular
.module('appMaster');
@giovanniramos
giovanniramos / gist:5716880
Last active December 18, 2015 03:18
Converts a character from a colon to HTML
<?php
/**
* Converts a character from a colon to HTML
*
* @param string $value The input string
* @return string
* @link https://gist.github.com/5716880
*
* */
function htmlColon($value)
@giovanniramos
giovanniramos / gist:4217717
Last active October 13, 2015 15:37
Interprets an INI file with heritage section
<?php
/**
* Interprets an INI file with heritage section
*
* @param string $filename Filename
* @return array
* @link https://gist.github.com/4217717
*
*/
function parse_ini_file_advanced($filename)
@giovanniramos
giovanniramos / gist:3190455
Created July 27, 2012 20:58
get_called_class < 5.3 [solution]
<?php
/**
* get_called_class < 5.3 [solution]
*
*/
function get_called_class()
{
$objects = array();
$traces = debug_backtrace();
@giovanniramos
giovanniramos / gist:3100679
Last active October 7, 2015 03:48
Returns the sum of occurrences, in an array of a given condition satisfied
<?php
/**
* Returns the sum of occurrences, in an array of a given condition satisfied
*
* @param mixed $value The value or array to be evaluated
* @param string $operator Operator of evaluation
* @param string $conditional Conditional assignment
* @return integer
* @link https://gist.github.com/3100679
*
@giovanniramos
giovanniramos / gist:3078188
Last active October 7, 2015 00:38
Removes the style markup in html tags, derived from a text editor
<?php
/**
* Removes the style markup in html tags, derived from a text editor
*
* @param string $value The input string
* @return string
* @link https://gist.github.com/3078188
*
* */
function clearStyle($value)
@giovanniramos
giovanniramos / LICENSE.txt
Created March 7, 2012 03:16 — forked from 140bytes/LICENSE.txt
140byt.es -- Click ↑↑ fork ↑↑ to play!
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@giovanniramos
giovanniramos / gist:1542593
Last active September 29, 2015 03:48
Checks through recursion, a list of keys that have a value EMPTY or NULL
<?php
/**
* Checks through recursion, a list of keys that have a value EMPTY or NULL
*
* @param array $haystack A simple/multi-dimensional array
* @param string $mandatory List with the names of keys that will be checked, separated by commas
* @return boolean
*
* */
function is_arrayEmpty($haystack, $mandatory = null)
@giovanniramos
giovanniramos / gist:1542587
Last active September 29, 2015 03:48
Checks if a value exists in an array
<?php
/**
* Checks if a value exists in an array
*
* @param mixed $needle The value sought
* @param array $haystack The array that will be verified
* @return boolean
*
* */
function in_multiarray($needle, $haystack)