Skip to content

Instantly share code, notes, and snippets.

@johnulist
johnulist / prestashop-autocompletion.php
Created January 6, 2016 01:47 — forked from xbb/prestashop-autocompletion.php
Prestashop autocompletion
<?php
class AbstractLogger extends AbstractLoggerCore {}
class Address extends AddressCore {}
class AddressFormat extends AddressFormatCore {}
class AdminTab extends AdminTabCore {}
class Alias extends AliasCore {}
class Attachment extends AttachmentCore {}
class Attribute extends AttributeCore {}
class AttributeGroup extends AttributeGroupCore {}
@johnulist
johnulist / PrestaShop Constants
Created January 6, 2016 01:46
PrestaShop Constants
<?php
define('PS_ROOT_DIR', realpath($currentDir.'/..'));
define('PS_CLASS_DIR', PS_ROOT_DIR.'/classes/');
define('PS_TRANSLATIONS_DIR', PS_ROOT_DIR.'/translations/');
define('PS_DOWNLOAD_DIR', PS_ROOT_DIR.'/download/');
define('PS_MAIL_DIR', PS_ROOT_DIR.'/mails/');
define('PS_MODULE_DIR', PS_ROOT_DIR.'/modules/');
define('PS_ALL_THEMES_DIR', PS_ROOT_DIR.'/themes/');
define('PS_THEME_DIR', PS_ROOT_DIR.'/themes/'.THEME_NAME.'/');
@johnulist
johnulist / parse-url.js
Created October 27, 2015 11:57 — forked from RockyMyx/parse-url.js
JavaScript: parse-url.js
//http://tutorialzine.com/2013/07/quick-tip-parse-urls/
$(function(){
// The URL we want to parse
var url = 'http://tutorialzine.com/2013/07/quick-tip-parse-urls/?key=value#comments';
// The magic: create a new anchor element, and set the URL as its href attribute.
// Notice that I am accessing the DOM element inside the jQuery object with [0]:
var a = $('<a>', { href:url } )[0];
@johnulist
johnulist / parseUrl.js
Created October 27, 2015 11:56 — forked from Gioni06/parseUrl.js
Javascript Parse URLs
function parseURL(url) {
var a = document.createElement('a');
a.href = url;
return {
source: url,
protocol: a.protocol.replace(':',''),
host: a.hostname,
port: a.port,
query: a.search,
params: (function(){
@johnulist
johnulist / example.js
Created October 27, 2015 11:55
Parsing URLs with the DOM!
var myURL = parseURL('http://abc.com:8080/dir/index.html?id=255&m=hello#top');
myURL.file; // = 'index.html'
myURL.hash; // = 'top'
myURL.host; // = 'abc.com'
myURL.query; // = '?id=255&m=hello'
myURL.params; // = Object = { id: 255, m: hello }
myURL.path; // = '/dir/index.html'
myURL.segments; // = Array = ['dir', 'index.html']
myURL.port; // = '8080'
@johnulist
johnulist / SourceCodeSearchEngines.md
Created September 28, 2015 01:44 — forked from phillipalexander/SourceCodeSearchEngines.md
Source Code Search Engines You Can Use For Programming Projects

Source Code Search Engines

NOTE: This list is almost entirely copy/pasted from THIS awesome article. I've made my own personal edits (adding some additional content) which is why I keep it here.

Every day meanpath crawls over 200 million websites capturing the visible text, HTML source code, CSS and Javascript. This information is used by many companies to monitor the growth of web facing technology.

// http://stackoverflow.com/questions/18432577/stacked-tabs-in-bootstrap-3
.tabs-below, .tabs-right, .tabs-left {
.nav-tabs {
border-bottom: 0;
}
}
.tab-content > .tab-pane,
.pill-content > .pill-pane {
display: none;
@johnulist
johnulist / uri.js
Created January 13, 2014 11:07 — forked from jlong/uri.js
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"