Skip to content

Instantly share code, notes, and snippets.

@AndreaCatania
AndreaCatania / ffmpeg.rs
Created November 11, 2019 11:00
FFmpeg example to extract a frame from a video in Rust Lang
/// This
unsafe {
ffmpeg::av_register_all();
// This portion of code was written by taking as resource: http://dranger.com/ffmpeg/tutorial01.html
// This article is outdated, and some APIs got deprecated, here I used the non deprecated version.
//
// The idea of FFmpeg is to
// 1. open the file

Screen Quick Reference

Basic

Description Command
Start a new session with session name screen -S <session_name>
List running sessions / screens screen -ls
Attach to a running session screen -x
Attach to a running session with name screen -r
@hscspring
hscspring / 结巴词性标记集
Last active May 20, 2024 10:32
结巴词性对照表
- a 形容词
- ad 副形词
- ag 形容词性语素
- an 名形词
- b 区别词
- c 连词
- d 副词
- df
- dg 副语素
- e 叹词
@DanDiplo
DanDiplo / JS-LINQ.js
Last active May 20, 2024 10:30
JavaScript equivalents of some common C# LINQ methods. To help me remember!
// JS array equivalents to C# LINQ methods - by Dan B.
// First: This version using older JavaScript notation for universal browser support (scroll down for ES6 version):
// Here's a simple array of "person" objects
var people = [
{ name: "John", age: 20 },
{ name: "Mary", age: 35 },
{ name: "Arthur", age: 78 },
{ name: "Mike", age: 27 },
@AsherJingkongChen
AsherJingkongChen / vue-auto-scroll-down-for-chat-app.ts
Last active May 20, 2024 10:29
Vue 3 custom auto scroll down directive for apps with chat room (terminal style)!
/**
* Auto Scroll Down - Vanilla JS
*/
export function useAutoScrollDown() {
let hadScrolledToBottom = true;
const hasScrolledToBottom = (target: Element): boolean => {
return (
target.clientHeight +
target.clientTop +
target.scrollTop >=
@marcojahn
marcojahn / conventional-commit-regex.md
Last active May 20, 2024 10:28
Conventional Commit Regex

the following regex will validate all examples provided here: https://www.conventionalcommits.org/en/v1.0.0/

  ^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test){1}(\([\w\-\.]+\))?(!)?: ([\w ])+([\s\S]*)

a grep/posix compatible variant

  ^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test){1}(\([[:alnum:]._-]+\))?(!)?: ([[:alnum:]])+([[:space:][:print:]]*)
@redoPop
redoPop / .gitignore
Created June 18, 2010 22:08
Template .gitignore file for WordPress projects
# This is a template .gitignore file for git-managed WordPress projects.
#
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
#
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
#
# See the comments below for more info on how to add exceptions for your
@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active May 20, 2024 10:30
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux
@irazasyed
irazasyed / outbound-email-with-cloudflare.md
Last active May 20, 2024 10:23
Using Gmail SMTP with Cloudflare Email Routing: A Step-by-Step Guide

Using Gmail SMTP with Cloudflare Email Routing: Step-by-Step Guide

Learn how to send emails through Gmail SMTP with Cloudflare Email Routing in this comprehensive guide.

Step 1: Enable 2-Factor Authentication

To proceed with this method, ensure that you have enabled two-factor authentication for your Google account. If you haven't done so already, you can follow the link to set it up → Enable 2FA in your Google account.

Step 2: Create an App Password for Mail

@cowboy
cowboy / mock-axios.js
Last active May 20, 2024 10:22
axios mocking via interceptors
import axios from 'axios'
let mockingEnabled = false
const mocks = {}
export function addMock(url, data) {
mocks[url] = data
}