Skip to content

Instantly share code, notes, and snippets.

View vvolodin's full-sized avatar

Volodymyr Volodin vvolodin

View GitHub Profile
public MyAwesomeService(IAnotherAwesomeService another!!, IMapper mapper!!)
{
_another = another;
_mapper = mapper;
}
public MyAwesomeService(IAnotherAwesomeService another, IMapper mapper)
{
_another = another ?? throw new ArgumentNullException(nameof(another));
_mapper = mapper ?? throw new ArgumentNullException(nameof(mapper));
}
int[] first = { 1 };
int[] second = { 1, 2, 3, 4 };
int[] third = { 1, 1, 0, 3, 5 };
Console.WriteLine(first is [1, 2]); // false, length
Console.WriteLine(second is [1, .., 4]); //true
Console.WriteLine(third is [_, >1, ..]); //false, 1 is not > 1
var location = $$"""
You are at {{{Longitude}}, {{Latitude}}}
""";
string longMessage = """"
This is a long message.
It has several lines.
Some are indented
more than others.
Some are """heavily""" quoted and it's still fine.
Some should start at the first column.
Some have "quoted text" in them.
"""";
@vvolodin
vvolodin / animation-good.ts
Created August 5, 2022 13:05
Angular crossfade good
trigger('fadeIn', [
state('in', style({ opacity: 1, display: 'block' })),
state('out', style({ opacity: 0, display: 'none' })),
transition('in => out', [
sequence([
style({ opacity: 1 }),
animate('0.15s ease-in-out', style({ opacity: 0 })),
style({ opacity: 0, display: 'none' })
])
]),
@vvolodin
vvolodin / animation-bad-1.ts
Last active August 5, 2022 10:08
article-1-snippet-1
trigger('fadeIn', [
state('in', style({ opacity: 1, display: 'block' })),
state('out', style({ opacity: 0, display: 'none' })),
transition('in => out', [
sequence([
style({ opacity: 1 }),
animate('0.15s ease-in-out', style({ opacity: 0 })),
style({ opacity: 0, display: 'none' })
])
]),
@vvolodin
vvolodin / delete-evicted-pods-all-namespaces.sh
Created March 26, 2019 17:10 — forked from psxvoid/delete-evicted-pods-all-namespaces.sh
Delete evicted pods from all namespaces (also ImagePullBackOff and ErrImagePull)
#!/bin/sh
# based on https://gist.github.com/ipedrazas/9c622404fb41f2343a0db85b3821275d
# delete all evicted pods from all namespaces
kubectl get pods --all-namespaces | grep Evicted | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod
# delete all containers in ImagePullBackOff state from all namespaces
kubectl get pods --all-namespaces | grep 'ImagePullBackOff' | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod
# delete all containers in ImagePullBackOff or ErrImagePull or Evicted state from all namespaces
patchValue(form:FormBuilder, object){
var iterate = (mForm:FormBuilder, mObject)=> {
for (var key in mObject) {
if (Array.isArray(mObject[key])) {
if(!mForm[key]){
if(Array.isArray(mForm.value)){
mForm.push(new FormArray([]))
} else {
mForm.addControl(key, new FormArray([]));
}
@vvolodin
vvolodin / gist:7b081d5684707ea9da21
Created October 21, 2014 14:23
GLOBAL SUPER EXTRA RANK
1. www.google.com - GLOBAL RANK 1
2. vlad.devmiles.com - GLOBAL RANK 2
3. blogger - GLOBAL RANK -666666.66
4. WORDPRESS - GLOBAL RANK - 3