Skip to content

Instantly share code, notes, and snippets.

View anein's full-sized avatar
👨‍🚀
Focusing

Alexander N. anein

👨‍🚀
Focusing
View GitHub Profile
@anein
anein / angularjs.es6.filter.js
Created February 8, 2016 13:57
Creating an angularjs filter using ES6
class MyFilter {
static filter( value ){
return value.toLowerCase();
}
}
export default MyFilter.filter;
@anein
anein / IIFE.js
Created December 19, 2016 01:48
IIFE variations
// 1
( function IIFE(){/*...*/} )();
// 2
( function IIFE(){/*...*/}() );
// 3
( function(){/*...*/} )();
// 4
( function IIFE( global ){/*...*/} )( window );
// 5
( function IIFE( undefined ){
@anein
anein / angular2.router.ts
Last active February 2, 2021 15:54
Angular2 Router with the url matcher.
export function MyAwesomeMatcher ( url: UrlSegment[] ): UrlMatchResult {
if (url.length === 0) {
return null;
}
const reg = /^(awesome-path)$/;
const param = url[ 0 ].toString();
if (param.match( reg )) {
([\u26F9\u261D]|[\u270A-\u270D]|[\U0001F385\U0001F386]|[\U0001F3C2-\U0001F3C4\U0001F3C7\U0001F3CA-\U0001F3CB]|[\U0001f466-\U0001f469\U0001f46E]|[\U0001f470-\U0001f478\U0001f47C]|[\U0001f481-\U0001f483\U0001f485-\U0001f487]|[\U0001F442\U0001F443\U0001F446-\U0001F44F]|[\U0001F450]|[\U0001F4AA]|[\U0001f574\U0001f575\U0001f57A]|[\U0001F590\U0001F595\U0001F596]|[\U0001F645-\U0001F647\U0001F64B-\U0001F64F]|[\U0001F6A3]|[\U0001F6B4-\U0001F6B6]|[\U0001F6C0\U0001F6CC]|[\U0001F918-\U0001F91F]|[\U0001F926]|[\U0001F930-\U0001F939\U0001F93C-\U0001F93E]|[\U0001F9D1-\U0001F9DF])[\U0001F3FB-\U0001F3FF]?(?:(?:\u200d(?:[\u2640\u2642]|[\U0001F680\U0001F4BB\U0001F3A4\U0001F692\u2708\U0001F3A8\U0001F52C\U0001F4BC\U0001F3ED\u2695\U0001F393\U0001F3EB\u2696\U0001F33E\U0001F373\U0001F527])?)?)(?:\U0000FE0F)?
@anein
anein / gist:40dc42629e791404793dcd23c43557d2
Created December 5, 2017 13:11
set a shortcut for switching between keyboard layouts in Gnome
gsettings set org.gnome.desktop.wm.keybindings switch-input-source "['<Shift>space']"
@anein
anein / idea.properties
Created December 5, 2017 21:56
Some extra options for WebStrom
# Sets experimental zero-latency typing like in Sublime and Vim
editor.zero.latency.typing=true
@anein
anein / webstorm64.vmoptions
Created December 5, 2017 21:56
My performance options for WebStorm with some explanatory comments
# Enables the server VM. Though this option is implicitly enabled on a 64-bit capable jdk
# Xms should be equal to Xmx.
-server
# Enables assertions
-ea
# Sets the initial size of the heap
-Xms2G
@anein
anein / gist:43abdef595111fd17115955601526ab4
Created January 6, 2018 17:35
Dell XPS 15 9560 - bluetooth fix.
# edit /etc/default/tlp
USB_BLACKLIST_BTUSB=1
@anein
anein / gist:9b77ed8daf2424adedfb61c49e722caa
Created July 5, 2018 08:41
Set keyboard layout Gnome
gsettings set org.gnome.desktop.wm.keybindings switch-input-source "['<Shift>space']"
@anein
anein / frisk.zsh-theme
Created March 27, 2019 14:35
My version of zsh frisk theme
PROMPT=$'
%{$fg[green]%}[%n@%m]%{$reset_color%} %{$fg_bold[blue]%}%/%{$reset_color%} %{$fg[user_color]%}[%T]%{$reset_color%} $(git_prompt_info)$(bzr_prompt_info)%{$fg_bold[black]%}>%{$reset_color%} '
PROMPT2="%{$fg_blod[black]%}%_> %{$reset_color%}"
GIT_CB="git::"
ZSH_THEME_SCM_PROMPT_PREFIX="%{$fg[green]%}["
ZSH_THEME_GIT_PROMPT_PREFIX=$ZSH_THEME_SCM_PROMPT_PREFIX$GIT_CB
ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}*%{$fg[green]%}"