Skip to content

Instantly share code, notes, and snippets.

View robophil's full-sized avatar
🍷
Working from home

Balogun Oghenerobo Philip robophil

🍷
Working from home
View GitHub Profile
@robophil
robophil / .vimrc
Last active May 13, 2019 09:08
configuration for my per project .vimrc
let $PATH = './node_modules/.bin:' . $PATH
let g:used_javascript_libs = 'react'
autocmd BufNewFile,BufEnter **/*.js setlocal filetype=javascript.jsx
if filereadable(".ctrlpignore")
let g:ctrlp_user_command = 'find %s -type f | grep -v "`cat ./.ctrlpignore`"'
endif
@robophil
robophil / mocha-guide-to-testing.js
Created April 11, 2018 08:10 — forked from samwize/mocha-guide-to-testing.js
Explain Mocha's testing framework - describe(), it() and before()/etc hooks
// # Mocha Guide to Testing
// Objective is to explain describe(), it(), and before()/etc hooks
// 1. `describe()` is merely for grouping, which you can nest as deep
// 2. `it()` is a test case
// 3. `before()`, `beforeEach()`, `after()`, `afterEach()` are hooks to run
// before/after first/each it() or describe().
//
// Which means, `before()` is run before first it()/describe()
@robophil
robophil / magento_url_rewrite.patch
Created April 8, 2018 08:02 — forked from edannenberg/magento_url_rewrite.patch
Fixes the catalog url rewrite indexer in Magento 1.7.x-1.9.x See https://github.com/magento/bugathon_march_2013/issues/265 for details.Update: DexterDee in the ticket above noted that the previous patch had some side effects. This updated patch still feels like duct tape but at least it seems to be free of the mentioned side effects. It also fix…
diff -rupN mage_org/app/code/core/Mage/Catalog/Model/Url.php src_shop/app/code/core/Mage/Catalog/Model/Url.php
--- mage_org/app/code/core/Mage/Catalog/Model/Url.php 2013-11-19 00:48:25.679009391 +0100
+++ src_shop/app/code/core/Mage/Catalog/Model/Url.php 2013-11-19 00:49:24.188005601 +0100
@@ -643,13 +643,24 @@ class Mage_Catalog_Model_Url
$this->_rewrite = $rewrite;
return $requestPath;
}
+
+ // avoid unnecessary creation of new url_keys for duplicate url keys
+ $noSuffixPath = substr($requestPath, 0, -(strlen($suffix)));
// GET https://api.fixer.io/latest?base=USD
{
"base": "USD",
"date": "2018-01-30",
"rates": {
"AUD": 1.2354,
"BGN": 1.5746,
"BRL": 3.1624,
"CAD": 1.2321,
"CHF": 0.93302,
@robophil
robophil / .bashrc
Last active January 23, 2018 22:22
cuda
export PATH=/usr/local/cuda-9.1/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-9.1/lib64\${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
@robophil
robophil / promisesEM.md
Created January 18, 2018 10:14 — forked from dmvaldman/promisesEM.md
Promises as EventEmitters

Promises as EventEmitters

I was trying to understand JavaScript Promises by using various libraries (bluebird, when, Q) and other async approaches.

I read the spec, some blog posts, and looked through some code. I learned how to

@robophil
robophil / load-env.sh
Last active November 24, 2017 13:15
Load env regardless before app starts
env $(cat .env) node app.js
@robophil
robophil / NERDTree.mkd
Created November 22, 2017 13:35 — forked from m3nd3s/NERDTree.mkd
My Vim Cheat Sheet

NERDTree

o.......Open files, directories and bookmarks....................|NERDTree-o|
go......Open selected file, but leave cursor in the NERDTree.....|NERDTree-go|
t.......Open selected node/bookmark in a new tab.................|NERDTree-t|
T.......Same as 't' but keep the focus on the current tab........|NERDTree-T|
i.......Open selected file in a split window.....................|NERDTree-i|
gi......Same as i, but leave the cursor on the NERDTree..........|NERDTree-gi|
s.......Open selected file in a new vsplit.......................|NERDTree-s|
gs......Same as s, but leave the cursor on the NERDTree..........|NERDTree-gs|

O.......Recursively open the selected directory..................|NERDTree-O|

@robophil
robophil / gist:b3be8492a423db2af6f034b708a1e7fe
Created September 29, 2017 09:11 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue: