Skip to content

Instantly share code, notes, and snippets.

View namxam's full-sized avatar

Maximilian Schulz namxam

View GitHub Profile
@namxam
namxam / ffmpeg-cheatsheet.md
Created September 21, 2021 12:12 — forked from nickkraakman/ffmpeg-cheatsheet.md
FFmpeg cheat sheet for 360 video

FFmpeg Cheat Sheet for 360º video

Brought to you by Headjack

 
FFmpeg is one of the most powerful tools for video transcoding and manipulation, but it's fairly complex and confusing to use. That's why I decided to create this cheat sheet which shows some of the most often used commands.

 
Let's start with some basics:

  • ffmpeg calls the FFmpeg application in the command line window, could also be the full path to the FFmpeg binary or .exe file
@namxam
namxam / wg-watchdog
Last active February 23, 2023 06:57 — forked from mattkasun/wg-watchdog.sh
wireguard watchdog script
#!/bin/bash
# 1. Save file to system /usr/bin
# 2. Make it executable
# 3. Add crontab entry:
# sudo su
# crontab -e
# Add `* * * * * /usr/bin/wg-watchdog`
#
# You can track history via `journalctl -f -t wg-watchdog`
@namxam
namxam / test.html
Created April 10, 2019 19:16
Hello World Html
<html>
<head>
<style>
h1 {
font-family: Calibri;
}
</style>
</head>
<body>
<h1>Hello World!</h1>
@namxam
namxam / test.md
Last active April 10, 2019 19:15
Hello World Markdown

Hello World

This is content converted from Markdown!

Here's a JSON sample:

{
  "foo": "bar"
}
@namxam
namxam / chainablePropType.js
Created March 28, 2017 13:43
React custom validator with isRequired support
const chainablePropType = predicate => {
const propType = (props, propName, componentName) => {
// don't do any validation if empty
if (props[propName] == null) {
return;
}
return predicate(props, propName, componentName);
}
import React, { Component } from 'react'
const MOBILE_MAX = 480
const TABLET_MAX = 1024
export const mobile = window.matchMedia(`(max-width: ${MOBILE_MAX}px)`)
export const isMobile = () => mobile.matches
export const tablet = window.matchMedia(`(min-width: ${MOBILE_MAX + 1}px) and (max-width: ${TABLET_MAX}px)`)
export const isTablet = () => tablet.matches
require 'torquebox-messaging'
require_relative '../models/subscriber'
module Box
module Services
class SubscriberActivation
DELAY = 60 * 60 * 24 * 1000
def self.logger
defmodule Exercise1 do
def maximum([head | tail]) do
maximum(tail, head)
end
defp maximum([], largest_score) do
largest_score
end
defp maximum([head | tail], largest_score) when largest_score > head do
@namxam
namxam / identicon.jsx
Last active September 4, 2015 11:52
React identicon component (react 0.14 required)
// Based on https://github.com/stewartlord/identicon.js
import React from 'react';
import md5 from 'md5';
class Identicon extends React.Component {
static propTypes = {
id: React.PropTypes.string.isRequired,
background: React.PropTypes.string,
padding: React.PropTypes.number,
@namxam
namxam / css.rb
Created March 18, 2015 10:57
Some method to generate a string of css classes
def conditional_css(*elements)
elements.map do |element|
if element.kind_of?(Hash)
element.select { |k, v| v }.keys
else
element.to_s
end
end.compact.join(' ')
end