These set of scripts are for Magento 1. For Magento 2, see this Gist.
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 characters
{ | |
"printWidth": 100, | |
"tabWidth": 4, | |
"useTabs": false, | |
"singleQuote": false, | |
"trailingComma": "none", | |
"braceStyle": "psr-2", | |
"requirePragma": false, | |
"insertPragma": false | |
} |
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 characters
/** | |
*@NApiVersion 2.x | |
*@NScriptType Restlet | |
*/ | |
define( | |
[ | |
'N/search', | |
'N/record', | |
'N/cache', | |
'N/format' |
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 characters
define([], function() { | |
/** | |
* Sample Client Script | |
* @NApiVersion 2.x | |
* @NModuleScope Public | |
* @NScriptType ClientScript | |
*/ | |
/* === VARS === */ |
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 characters
<?php | |
/** | |
* Get string between start => end | |
* | |
* @param $string | |
* @param $start | |
* @param $end | |
* | |
* @return string |
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 characters
def fcntl(fd, op, arg=0): | |
return 0 | |
def ioctl(fd, op, arg=0, mutable_flag=True): | |
if mutable_flag: | |
return 0 | |
else: | |
return "" | |
def flock(fd, op): |
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 characters
'use strict'; | |
const http = require('http'), | |
net = require('net'); | |
const config = { | |
port: process.env.port || 1193, | |
}; |
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 characters
Show hidden characters
{ | |
"bootstrapped": true, | |
"in_process_packages": | |
[ | |
], | |
"installed_packages": | |
[ | |
"A File Icon", | |
"Alignment", | |
"All Autocomplete", |
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 characters
{ | |
"workbench.iconTheme": "material-icon-theme", | |
"editor.fontSize": 15, | |
"[json]": { | |
"editor.defaultFormatter": "esbenp.prettier-vscode" | |
}, | |
"[javascript]": { | |
"editor.defaultFormatter": "esbenp.prettier-vscode" | |
}, | |
"editor.tabSize": 2, |
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 characters
// Thanks to https://bytemaster.io/filter-javascript-objects-fuzzy-search | |
Array.prototype.fuzzySearch = function (query) { | |
var search = query.split(' '); | |
var ret = this.reduce((found, i) => { | |
var matches = 0; | |
search.forEach(s => { | |
var props = 0; | |
for (var prop in i) { | |
if (i[prop].indexOf(s) > -1) { | |
props++; |