Skip to content

Instantly share code, notes, and snippets.

@nicolae-olariu
nicolae-olariu / any.component.html
Created July 18, 2022 07:49 — forked from arniebradfo/any.component.html
Angular *ngFor recursive list tree template
<h1>Angular 2 Recursive List</h1>
<ul>
<ng-template #recursiveList let-list>
<li *ngFor="let item of list">
{{item.title}}
<ul *ngIf="item.children.length > 0">
<ng-container *ngTemplateOutlet="recursiveList; context:{ $implicit: item.children }"></ng-container>
</ul>
</li>
</ng-template>
@nicolae-olariu
nicolae-olariu / ffmpeg-hls.html
Created October 2, 2021 21:05 — forked from CharlesHolbrow/ffmpeg-hls.html
Example of ffmpeg for live hls streaming with hls.js
<!DOCTYPE html>
<html lang='`en'>
<head>
<meta charset='utf-8'/>
<title>Audio only stream example</title>
<script src="//cdn.jsdelivr.net/npm/hls.js@latest"></script>
<style>
video {
width: 640px;
height: 360px;
@nicolae-olariu
nicolae-olariu / Observable_in_vanillaJS.md
Created October 30, 2019 09:14 — forked from ltciro/Observable_in_vanillaJS.md
simulate pattern observable in vanilla JS

Rxjs

const next = (message)=> console.log("First observer message: " + message);
const error = (error) => console.log("Second observer error: " + error);
const complete = () => console.log("complete");

const next1 = (message)=> console.log("First observer message 1: " + message);
const error1 = (error) => console.log("Second observer error 1: " + error);
const complete1 = () => console.log("complete 1");
@nicolae-olariu
nicolae-olariu / git_create_orphan.sh
Created January 9, 2019 07:33 — forked from seanbuscay/git_create_orphan.sh
Create an orphan branch in a repo.
cd repository
git checkout --orphan orphan_name
git rm -rf .
rm '.gitignore'
echo "#Title of Readme" > README.md
git add README.md
git commit -a -m "Initial Commit"
git push origin orphan_name
@nicolae-olariu
nicolae-olariu / flush-dns.sh
Created January 30, 2018 10:00 — forked from craigvantonder/flush-dns.sh
Flushing the DNS in Ubuntu 16.04
#!/bin/bash
# NB: First install nscd with sudo apt-get install nscd
# run this command to flush dns cache:
sudo /etc/init.d/dns-clean restart
# or use:
sudo /etc/init.d/networking force-reload
# Flush nscd dns cache:
sudo /etc/init.d/nscd restart
@nicolae-olariu
nicolae-olariu / bash-smtp-auth-email
Created November 24, 2017 12:17 — forked from fbatschi/bash-smtp-auth-email
How to send an email from bash via SMTP Auth
echo "PUT YOUR MAIL BODY HERE" | mailx -s "SUBJECT" -S smtp=smtp://yoursmtpserver.com -S smtp-auth=login -S smtp-auth-user=YOUR_USERNAME -S smtp-auth-password=YOUR_PASSWORD -S from="Sender Name <sender@mail.com>" recipient@mail.com
@nicolae-olariu
nicolae-olariu / branch-count.sh
Created October 10, 2017 11:35 — forked from rwaldron/branch-count.sh
Count number of branches in a repo
git branch | wc -l
@nicolae-olariu
nicolae-olariu / .htaccess
Created February 21, 2017 21:30 — forked from jentanbernardus/.htaccess
.htaccess Rules for Better Google Page Speed Results - Here's a set of default rules that I add to any site that I want to significantly increase the speed of. It took a lot of weeding through and testing, but this seems to work the best and will (guarantee not included) increase your Google Page Speed score by taking care of a lot of the cache …
# Turn on Expires and set default to 0
ExpiresActive On
ExpiresDefault A0
# Set up caching on media files for 1 year (forever?)
<FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav)$">
ExpiresDefault A29030400
Header append Cache-Control "public"
</FilesMatch>
@nicolae-olariu
nicolae-olariu / _decimal.scss
Created December 22, 2015 11:09 — forked from terkel/_decimal.scss
Rounding decimals in Sass
// _decimal.scss | MIT License | gist.github.com/terkel/4373420
// Round a number to specified digits.
//
// @param {Number} $number A number to round
// @param {Number} [$digits:0] Digits to output
// @param {String} [$mode:round] (round|ceil|floor) How to round a number
// @return {Number} A rounded number
// @example
// decimal-round(0.333) => 0
@nicolae-olariu
nicolae-olariu / gist:e81177a945b49cae2999
Created November 19, 2015 09:44 — forked from AndreasMadsen/gist:2693051
base64 shim [atob, btoa]
// Source: http://code.google.com/p/gflot/source/browse/trunk/flot/base64.js?r=153
/* Copyright (C) 1999 Masanao Izumo <iz@onicos.co.jp>
* Version: 1.0
* LastModified: Dec 25 1999
* This library is free. You can redistribute it and/or modify it.
*/
/*
* Interfaces: