Skip to content

Instantly share code, notes, and snippets.

View kuncevic's full-sized avatar
🎯
Focusing

Aliaksei Kuncevič kuncevic

🎯
Focusing
View GitHub Profile
@kuncevic
kuncevic / figletpreview.sh
Created September 20, 2021 09:14 — forked from crahan/figletpreview.sh
Print out a preview of all installed Figlet fonts.
#!/bin/sh
if [ "$#" -ne 1 ]; then
echo "I need some text to print."
exit 1
fi
for i in `ls /usr/local/Cellar/figlet/2.2.5/share/figlet/fonts/*.flf`; do
echo -e "==== $(basename $i) ====\n"
figlet -f $i $1
@kuncevic
kuncevic / ngconf-snippets-new.md
Created May 7, 2021 08:12 — forked from brandonroberts/ngconf-snippets-new.md
Component Router (New) snippets

Snippets for workshop

Step 1 - Home Route

<base href="/">

'@angular/router':                   { main: 'index.js', defaultExtension: 'js' },

import {ROUTER_PROVIDERS} from '@angular/router';
@kuncevic
kuncevic / landingpage.html
Created January 7, 2021 11:28 — forked from jasonalderman/landingpage.html
Simple, single-page, "coming soon" landing page template.
<!DOCTYPE html>
<html>
<head>
<!-- This is a template for a landing page!
✓ Fill in the things between the {{double braces}}, removing the {{ and }} in the process.
✓ Make a logo image for the <img> tag, and take note of its width and height.
✓ Make a sharing image for the OpenGraph/Facebook/Twitter <meta> tags (square, 1200x1200px).
✓ Tweak CSS as necessary.
✓ Rename this file to index.html and upload it and the two images to the web root directory on your server.
✓ Remove this comment when done. -->
@kuncevic
kuncevic / terminal-gif.md
Created June 18, 2019 07:37 — forked from protrolium/terminal-gif.md
convert images to GIF in Terminal

Install ImageMagick

brew install ImageMagick

Pull specific region of frames from video file w/ ffmpeg

ffmpeg -ss 14:55 -i video.mkv -t 5 -s 480x270 -f image2 %04d.png

  • -ss 14:55 gives the timestamp where I want FFmpeg to start, as a duration string.
  • -t 5 says how much I want FFmpeg to decode, using the same duration syntax as for -ss.
  • -s 480x270 tells FFmpeg to resize the video output to 480 by 270 pixels.
  • -f image2 selects the output format, a series of still images — make sure there are leading zeros in filename.
@kuncevic
kuncevic / osx_wifi_strenght_command_line.sh
Created March 4, 2019 01:22 — forked from miglen/osx_wifi_strenght_command_line.sh
Mac OS X Wifi Signal strength meter command line
#!/bin/bash
# Simple command to display the wireless strenght signal
#
clear
while x=1
do /System/Library/PrivateFrameworks/Apple*.framework/Versions/Current/Resources/airport -I \
| grep CtlRSSI \
| sed -e 's/^.*://g' \
| xargs -I SIGNAL printf "\rWifi dBm: SIGNAL"
sleep 0.5
@kuncevic
kuncevic / zeit-now-g-suite-setup.md
Last active December 21, 2020 01:51 — forked from jaydenseric/zeit-now-g-suite-setup.md
Zeit Now G Suite setup

Run each of the following lines, replacing yourdomain.com and codehere with your details:

vc dns add yourdomain.com @ TXT google-site-verification=codehere
vc dns add yourdomain.com @ MX ASPMX.L.GOOGLE.COM 1
vc dns add yourdomain.com @ MX ALT1.ASPMX.L.GOOGLE.COM 5
vc dns add yourdomain.com @ MX ALT2.ASPMX.L.GOOGLE.COM 5
vc dns add yourdomain.com @ MX ALT3.ASPMX.L.GOOGLE.COM 10
vc dns add yourdomain.com @ MX ALT4.ASPMX.L.GOOGLE.COM 10
import { BehaviorSubject, of } from 'rxjs';
import { distinctUntilChanged, concatMap, map, take } from 'rxjs/operators';
export class StateDef<T> extends BehaviorSubject<T> {
setState(setter: (state: T) => T) {
this.pipe(take(1)).subscribe(state => {
super.next(setter(state));
});
}
import { Input } from '@angular/core';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
export function InputObservable<T>(inputName?: string) {
return (target: object, name: string): void => {
const subject = new BehaviorSubject(this[name]);
if (delete target[name]) {
Object.defineProperty(target, name, {
set(value: T): void {
@kuncevic
kuncevic / sample.html
Created January 22, 2018 22:28 — forked from guillaumegarcia13/sample.html
Angular 4 ng-template & ng-container with parameters
<ng-template #followingpost let-author="author" let-age="age" let-text="text" let-badge="badge">
<div class="container-fluid">
<div class="card">
<div class="header">
<h4 class="title">{{ author }}</h4>
<p class="category">il y a {{ age }} jours</p>
</div>
<div class="content" [innerHTML]="text">
</div>