This file contains 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
const requiredIf(condition: (control: AbstractControl) => boolean): (control: FormControl) => ValidationResult { | |
return (control: FormControl): ValidationResult => { | |
// Important: control.parent might not be defined, depending on your form structure | |
return !condition(control.parent) || !!control.value ? null : { [`required_if`]: true }; | |
}; | |
} |
This file contains 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
# Path to your oh-my-zsh installation. | |
export ZSH=/Users/sheniff/.oh-my-zsh | |
# Set name of the theme to load. | |
# Look in ~/.oh-my-zsh/themes/ | |
# Optionally, if you set this to "random", it'll load a random theme each | |
# time that oh-my-zsh is loaded. | |
ZSH_THEME="robbyrussell" | |
# Uncomment the following line to use case-sensitive completion. |
This file contains 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
# I can choose multiple folders with {} and random depth levels with ** | |
for file in client/{app,components}/**/*.js | |
do | |
mv "$file" "${file%.js}.ts" | |
done |
This file contains 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
Download the following ZIPs: | |
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links) | |
Download the correct GApps for your Android version: | |
Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip) | |
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip) | |
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip) | |
Google Apps for Android 4.4.4 (https://www.androidfilehost.com/?fid=23501681358544845 - gapps-kk-20140606-signed.zip) | |
Google Apps for Android 4.3 (https://www.androidfilehost.com/?fid=23060877490000124 - gapps-jb-20130813-signed.zip) |
This file contains 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
;(function() { | |
var throttle = function(type, name, obj) { | |
var obj = obj || window; | |
var running = false; | |
var func = function() { | |
if (running) { return; } | |
running = true; | |
requestAnimationFrame(function() { | |
obj.dispatchEvent(new CustomEvent(name)); | |
running = false; |
This file contains 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
ʘ‿ʘ | |
Innocent face | |
ಠ_ಠ | |
Reddit disapproval face | |
(╯°□°)╯︵ ┻━┻ | |
Table Flip / Flipping Table | |
┬─┬ ノ( ゜-゜ノ) |
This file contains 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
alias g='git' | |
alias gs='git status -s' | |
alias grb='git rebase' | |
alias rbm='git rebase master' | |
alias gra='git rebase --abort' | |
alias gah='git reset --hard' | |
alias gr2='git rebase -i -p HEAD~2' | |
alias gr3='git rebase -i -p HEAD~3' | |
alias gr4='git rebase -i -p HEAD~4' |
This file contains 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
var getPalindrome = function(num) { | |
var str = num.toString().split(''), | |
len = str.length, | |
half = len / 2; | |
for(var i = 0; i < half; i++) { | |
str[len - 1 - i] = str[i]; | |
} | |
return parseInt(str.join(''), 10); |
This file contains 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
var number = 600851475143; | |
var isPrime = function(num) { | |
var i = Math.ceil(Math.sqrt(num)), | |
end = Math.ceil(num / 2); | |
for(; i < end; i++) { | |
if (num % i === 0) return false; | |
} |
This file contains 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
var sum = 2, | |
prev = 1, | |
prev2 = 2, | |
curr; | |
while ((curr = prev + prev2) < 4000000) { | |
prev = prev2; | |
prev2 = curr; | |
!(curr % 2) && (sum += curr); |
NewerOlder