Skip to content

Instantly share code, notes, and snippets.

Download

vs() { yt-dlp -f "bv*+ba" --downloader ffmpeg --external-downloader-args "ffmpeg_i:-ss $1 -to $2" "${@:3}" -o "%(title)s.%(ext)s"; }
vs 00:10:17 00:11:08 https://www.youtube.com/watch?v=foo
@metaxy
metaxy / GoodPDFs.markdown
Last active March 4, 2024 04:32
Making good pdfs on linux

1. Fixing PDFs

Rotate and split pages

PDF Arranger: [Github] | [ubuntuusers.de] (5/5 ⭐)

2. Create a good Scan

2.1. Extract images of the pages

@metaxy
metaxy / export.php
Created February 22, 2018 09:29
Export all Magento Invoices as PDF
<?php
// this file should be copied to root
require_once('app/Mage.php');
Mage::app();
$maxOrderId = 24346;
for($orderId = 1; $orderId < $maxOrderId; $orderId++) {
$orderObject = Mage::getModel('sales/order')->load($orderId);
echo "$orderId of $maxOrderId\n";
$invoiceCollection = $orderObject->getInvoiceCollection();
<?php
$vimeoConfig = \Yii::$app->params['secrets']['vimeo'];
$lib = new \Vimeo\Vimeo("", "", "");
$next = "/me/videos?fields=name,uri,download&page=$page";
$videos = $lib->request($next);
if (isset($videos['body']['error'])) {
die(print_r($videos));
}
echo $videos['headers']['X-RateLimit-Remaining'];

Keybase proof

I hereby claim:

  • I am metaxy on github.
  • I am metaxy (https://keybase.io/metaxy) on keybase.
  • I have a public key ASBAOiGHDid0O0GeaWhzawRhSYGn3GcozNkb1vPc6ezPGAo

To claim this, I am signing this object:

@metaxy
metaxy / bakersmap.hs
Created December 16, 2011 19:28
Baker's map
import Graphics.Gnuplot.Simple
import Data.Ratio
f :: Rational -> Rational
f x
| x >= 0 && x <= 0.5 = 2*x
| x > 0.5 && x <= 1 = 2-2*x
f2 :: Rational -> Rational
f2 x
@metaxy
metaxy / quine.hs
Created October 21, 2011 11:59
Quine McCluskey
import List
import Maybe
type Var = (Int, Bool)
type Minterm = [Var]
type Tabelle = [Zelle]
type Zelle = (Minterm,[Int])
type Table a b = [[(a,b)]]
data In a = W | F | N
instance Show a => Show (In a) where
#!/usr/bin/env ruby
$data = "";
$lines = Array.[](1, 30, 21, 8, 5, 19, 46, 3, 22, 20, 74, 9, 1, 86, 1, 12, 12, 8, 1, 13,
295, 4, 25, 96, 2, 2, 327, 37, 1, 1, 9, 34, 11, 3, 3, 9, 1, 5, 2, 13,
20, 79, 1, 1, 1, 1, 4, 55, 1, 17, 1, 1, 1, 4, 2, 104, 12, 235, 37);
$linesStart = Array.new(11842);
$wordList = Array.new(1000);
def removeStuff(string)
return string.delete("^a-zA-Z").downcase
@metaxy
metaxy / Hanoilike.hs
Created August 26, 2011 06:47
Hanoilike
import Data.List
data Box = A | B | C | D | X deriving (Show,Eq)
boxLength = 4
type Zeile = [Box]
type All = (Zeile,Zeile)
start :: All
@metaxy
metaxy / hanoi
Created August 25, 2011 10:15
Billige Türme von Hanoi
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static int[] r1 = new int[4];