Skip to content

Instantly share code, notes, and snippets.

:octocat:
#building

Leon Gaban leongaban

:octocat:
#building
Block or report user

Report or block leongaban

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@leongaban
leongaban / RamdaGetKeyName.js
Created Sep 7, 2016
Get name of key that is true
View RamdaGetKeyName.js
let tabs = {
twitter: true,
news: false,
blogs: false,
finNews: false
}
const isTrue = R.equals(true);
const getActive = R.filter(isTrue);
@marcbachmann
marcbachmann / .hyperterm.js
Last active Dec 22, 2018
hyperterm config
View .hyperterm.js
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 12.5,
// font family with optional fallbacks
fontFamily: '"Meslo LG S for Powerline", Menlo, "DejaVu Sans Mono", "Lucida Console", monospace',
// terminal cursor background color (hex)
cursorColor: 'rgba(255,255,255,.4)',
View My Sublime 3 settings
{
"auto_complete_commit_on_tab": true,
"color_scheme": "Packages/Oceanic Next Color Scheme/Oceanic Next.tmTheme",
"draw_white_space": "all",
"font_face": "Fira Mono",
"font_size": 20,
"tab_size": 2,
"theme": "Brogrammer.sublime-theme",
"translate_tabs_to_spaces": true,
"trim_automatic_white_space": true,
@leongaban
leongaban / gup.js
Created Mar 3, 2016
Get variable from URL param
View gup.js
// For url with ?search=param
// http://stackoverflow.com/a/979997/168738
function gurlp( name, url ) {
if (!url) url = location.href;
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&]"+name+"=([^&#]*)";
var regex = new RegExp( regexS );
var results = regex.exec( url );
return results == null ? null : results[1];
View bling.js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;
@tonymtz
tonymtz / gist:d75101d9bdf764c890ef
Last active Jul 12, 2019
Uninstall nodejs from OSX Yosemite
View gist:d75101d9bdf764c890ef
# first:
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*
# To recap, the best way (I've found) to completely uninstall node + npm is to do the following:
# go to /usr/local/lib and delete any node and node_modules
cd /usr/local/lib
sudo rm -rf node*
@paulakreuger
paulakreuger / angular-filters.js
Last active Apr 19, 2019
Capitalize First Letter Filter - AngularJS
View angular-filters.js
app.filter('capitalize', function() {
return function(input, scope) {
if (input!=null)
input = input.toLowerCase();
return input.substring(0,1).toUpperCase()+input.substring(1);
}
});
@demisx
demisx / angularjs-providers-explained.md
Last active Jun 8, 2019
AngularJS Providers: Constant/Value/Service/Factory/Decorator/Provider
View angularjs-providers-explained.md
Provider Singleton Instantiable Configurable
Constant Yes No No
Value Yes No No
Service Yes No No
Factory Yes Yes No
Decorator Yes No? No
Provider Yes Yes Yes

Constant

@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active Jul 15, 2019
A badass list of frontend development resources I collected over time.
View frontendDevlopmentBookmarks.md
@phette23
phette23 / current-dir-in-iterm-tab-title.sh
Last active Jul 16, 2019
Set the iTerm tab title to the current directory, not full path.
View current-dir-in-iterm-tab-title.sh
# put this in your .bash_profile
if [ $ITERM_SESSION_ID ]; then
export PROMPT_COMMAND='echo -ne "\033];${PWD##*/}\007"; ':"$PROMPT_COMMAND";
fi
# Piece-by-Piece Explanation:
# the if condition makes sure we only screw with $PROMPT_COMMAND if we're in an iTerm environment
# iTerm happens to give each session a unique $ITERM_SESSION_ID we can use, $ITERM_PROFILE is an option too
# the $PROMPT_COMMAND environment variable is executed every time a command is run
# see: ss64.com/bash/syntax-prompt.html
You can’t perform that action at this time.