Skip to content

Instantly share code, notes, and snippets.

View jonabaptistella's full-sized avatar

Jonathan Baptistella jonabaptistella

View GitHub Profile
  1. Open terminal.
  2. Use any one of following to install youtube-dl (A downloader written in python).
    • Fire these 2 command if you have curl installed.
    sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl 
    sudo chmod a+rx /usr/local/bin/youtube-dl
    
    • Fire these 2 commands

sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl

Install ffmpeg

brew install ffmpeg

Download file through url, like this:

ffmpeg -protocol_whitelist file,http,https,tcp,tls,crypto -i "http://url-file.domain.m3u8" -c copy video.mp4
@jonabaptistella
jonabaptistella / get-vimeo-private-video-thumb.php
Created April 17, 2020 20:44 — forked from luisabarca/get-vimeo-private-video-thumb.php
Get a thumbnail from Vimeo private videos
<?php
// You need Vimeo API https://github.com/vimeo/vimeo.php
require 'path-to-your-lib/vimeo/vimeo.php';
// Get this from your account
$vimeo_client_id = 'xxxxx';
$vimeo_client_secret = 'xxxxxxxxxxx';
// This has to be generated on your site, plugin or theme
$vimeo_token = 'xxxxxx';
@jonabaptistella
jonabaptistella / youtube_id_regex.php
Created April 17, 2020 20:03 — forked from ghalusa/youtube_id_regex.php
Extract the YouTube Video ID from a URL in PHP
<?php
// Here is a sample of the URLs this regex matches: (there can be more content after the given URL that will be ignored)
// http://youtu.be/dQw4w9WgXcQ
// http://www.youtube.com/embed/dQw4w9WgXcQ
// http://www.youtube.com/watch?v=dQw4w9WgXcQ
// http://www.youtube.com/?v=dQw4w9WgXcQ
// http://www.youtube.com/v/dQw4w9WgXcQ
// http://www.youtube.com/e/dQw4w9WgXcQ
// http://www.youtube.com/user/username#p/u/11/dQw4w9WgXcQ
@jonabaptistella
jonabaptistella / methods.php
Created March 22, 2020 20:01 — forked from texnixe/methods.php
Collection of custom Kirby page, pages, field etc. methods
<?php
// page methods
// check if page has Parents
page::$methods['hasParents'] = function($page) {
return $page->parents()->count();
};
// get max nesting level of page
/* http://meyerweb.com/eric/tools/css/reset/
v2.0-modified | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
# Terminal Cheat Sheet
pwd # print working directory
ls # list files in directory
cd # change directory
~ # home directory
.. # up one directory
- # previous working directory
help # get help
-h # get help

Disable HTML Form Input Autocomplete and Autofill

  1. Add autocomplete="off" onto <form> element;
  2. Add hidden <input> with autocomplete="false" as a first children element of the form.
<form autocomplete="off" method="post" action="">
    <input autocomplete="false" name="hidden" type="text" style="display:none;">
    ...
@jonabaptistella
jonabaptistella / hook.sh
Created October 21, 2019 23:59 — forked from kotnik/hook.sh
Git update hook to allow only signed commits
#!/usr/bin/env bash
##############################################################################
#
# check-commit-signature
# ----------------------
# A server-side update git hook for checking the GPG signature of a pushed
# commit.
#
# To enable this hook, rename this file to "update".
#
@jonabaptistella
jonabaptistella / git_cheat-sheet.md
Created October 21, 2019 15:11 — forked from davfre/git_cheat-sheet.md
git commandline cheat-sheet