Skip to content

Instantly share code, notes, and snippets.

@jonath92
jonath92 / install-Update-Youtube-dl.sh
Last active March 1, 2024 11:50
Install-Update-Youtube-dl Linux Mint
# This is a simple script for install youtube-dl and creating a script in /etc/cron.daily
# to automatically update youtube-dl on a daily basis.
# can be executed with:
# sudo su -c "bash <(wget -qO- https://gist.githubusercontent.com/jonath92/0f6bf4606bc8a34be1bb0826c99b73d1/raw/914aabe6c4b15dc614f18c8816f5ad2828755c22/install-Update-Youtube-dl.sh)" root
# Remove apt version to prevent conflicts
apt purge -y youtube-dl
# Fix python not found error https://askubuntu.com/a/1149489/1013434
ln -s /usr/bin/python3 /usr/local/bin/python
@martinratinaud
martinratinaud / FullPageLayout.tsx
Last active March 7, 2022 20:48
typescript Dot Notation styled-components
import * as React from 'react';
import styled from 'styled-components';
const FullPageLayout = styled<any>(styled.div``)`
display: flex;
flex-direction: column;
`;
interface HeaderProps {
fixed?: boolean;
@ICEDLEE337
ICEDLEE337 / lodash-throttle.js
Created November 16, 2017 03:25
example of using lodash's `throttle`
(() => {
// in this example we invoke a fn for a period of 10 sec, invoking it 10 times a second, but we can perceive that the original function is only invoked at most once per second according to the parameter below
var TOTAL_TIME_TO_RUN = 10000; // 10 sec
var THROTTLE_INTERVAL = 2000; // <= adjust this number to see throttling in action
var INVOCATION_INTERVAL = 100; // 0.1 sec
// regular fn
var punchClock = function punchClock () {