Skip to content

Instantly share code, notes, and snippets.

Working from home

Jorge Morales morales2k

Working from home
View GitHub Profile
morales2k / make_links
Created Apr 18, 2014
Function to make links inside blobs of text by matching urls and replacing them with the links... includes support for cyrilic characters... still has some quirks to work out... but it works on pretty much all cases as far as I have tested it... feel free to suggest improvements! :)
View make_links
morales2k / getCookie.js
Created May 29, 2014
doSomething in js based on wether or not a cookie is set with the getCookie function
View getCookie.js
function getCookie(name) {
var dc = document.cookie;
var prefix = name + "=";
var begin = dc.indexOf("; " + prefix);
if (begin == -1) {
begin = dc.indexOf(prefix);
if (begin != 0) return null;
morales2k / preg_match magic.php
Last active Aug 29, 2015
Youtube regex to extract video id from most youtube urls... from stack overflow answer:
View preg_match magic.php
$yturl = '';
other possible urls...
morales2k / videoData.class.php
Created Jul 31, 2014
Get youtube video info and embed code from input youtube url. Can be easily modified to use different "part" queries... but I'm doing just the snippet and player ones here...
View videoData.class.php
class videoData{
static $videoId = '';
static $videoData = array();
static private $apiKey = '[YOUR_API_KEY_HERE]';
static $url = ',player&key=@@APIKEY@@';
static $lastURL = '';
static function getIdFromURL($url){
morales2k / UserDataHelper.php
Created Sep 24, 2014
PHP-Fusion class to fetch user data.
View UserDataHelper.php
| PHP-Fusion Content Management System
| Copyright (C) PHP-Fusion Inc
| Filename: UserDataHelper.php
| Author: Jorge Morales (Elvenelf / EffectiX.Net)
| This program is released as free software under the
morales2k /
Created Oct 2, 2015
Bump deployed version tag inside .env file. For use with and Laravel 5 to update a VERSION var inside the .env file of your Envoyer releases.
#! /bin/bash
filelines=`cat $archivo`
echo "Fetching dirty tags from remote repository..."
gitVersion=`git ls-remote -t {{REPOSITORY-URL}} *.*.*^*`
morales2k / default.sublime-keymap
Last active Dec 20, 2015
Sublime Text 2 reindent full document shortcut keybinding. This gist is to be added to user keybindings to set f12 key to issue the reindent command to the complete document instead of doing it to a single line as it does when doing it from the menu. One normally selects all the document before doing this command from the menu, with the argument…
View default.sublime-keymap
"keys": ["f12"],
"command": "reindent",
"args": {
"single_line": false
morales2k / gist:6193580
Last active Dec 20, 2015
Google Analytics function for custom events for analytics.js Use it anyway you want, from simply adding onclick attribute to an element other than <a> to track a click event. Easily customizable to make it track other stuff besides event hitType, or click action for that matter. See analytics.js documentation…
View gist:6193580
* Tracking function to be used with the new analytics.js (i,s,o,g,r,a,m) snippet
* @param el string Identifier for the tracking click event
* @author Jorge L. Morales (EffectiX.Net)
* @return void
function gaTrack(el){
'hitType': 'event',
morales2k / gaq.push
Created Nov 7, 2013
Google Analytics -> One push, multiple UA tracking codes.
View gaq.push
['_setAccount', 'UA-XXXXX-1'],
['b._setAccount', 'UA-XXXXX-2'],
morales2k / jquery-sidr.js
Created Jul 8, 2014
The jquery-sidr fix that made it work for me in all browsers. Try it out and see if it helps!
View jquery-sidr.js
* Sidr
* Copyright (c) 2013 Alberto Varela
* Licensed under the MIT license.
;(function( $ ){
You can’t perform that action at this time.