Skip to content

Instantly share code, notes, and snippets.

@m4p
m4p / ampel.js
Last active Dec 7, 2020
Corona Ampel Berlin Widget für Scriptable.app
View ampel.js
// Corona Ampel Berlin Widget
//
// Copyright (C) 2020 by map <mail@map.wtf>
//
// Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
// IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
View twitch-schedule.js
// Scrapes a twitch streamers schedule and generates an ics
const icalToolkit = require('ical-toolkit');
const axios = require('axios');
const fs = require('fs');
var builder = icalToolkit.createIcsFileBuilder();
builder.spacers = true; //Add space in ICS file, better human reading. Default: true
builder.NEWLINE_CHAR = '\n'; //Newline char to use.
builder.throwError = false; //If true throws errors, else returns error when you do .toString() to generate the file contents.
View double_ender_sync.py
#!/usr/local/bin/python3
from pydub import AudioSegment
from pyAudioAnalysis import audioBasicIO as aIO
from pyAudioAnalysis import audioSegmentation as aS
import sys
import numpy
from scipy.io import wavfile
from scipy.signal import fftconvolve
def usage():
View ssa2ytt.py
import pysubs2
import re
import sys
from xml.sax.saxutils import escape
print (sys.argv[1])
subs = pysubs2.load(sys.argv[1], encoding="utf-8")
View memoji.m
AVTPersonalAnimoji *memoji =[ASPersonalAnimoji personalAnimoji];
[memoji setPreset:[AVTPreset presetWithCategory:5 identifier:@"rectangle"] forCategory:2];
[memoji setPreset:[AVTPreset presetWithCategory:2 identifier:@"horseshoe_ducktail"] forCategory:2];
[memoji setPreset:[AVTPreset presetWithCategory:1 identifier:@"straight_short_back"] forCategory:1];
self.avatarInstance = (AVTAvatarInstance *)memoji;
/*
Categories:
1: Hair
View belong.io.gs
function Twitter_RSS() {
return;
}
function doGet(e) {
var widgetID = e.queryString? e.queryString : "ERROR_NO_ID_FOUND";
var cache = CacheService.getPublicCache();
var id = "Twitter" + widgetID;
var rss = cache.get(id);
View belong.io.gs
function Twitter_RSS() {
return;
}
function doGet(e) {
var widgetID = e.queryString? e.queryString : "ERROR_NO_ID_FOUND";
var cache = CacheService.getPublicCache();
var id = "Twitter" + widgetID;
var rss = cache.get(id);
View flvs2m4v
#!/bin/bash
NAME=$1
PWD=`pwd`
ffmpeg -f concat -i <(find . -type f -name "${NAME}*.flv" | cut -c 2- | awk "{print \"file '\" \"${PWD}\" \$0 \"'\"}") -c copy "$NAME.m4v"
@m4p
m4p / twitch-downloader
Last active Aug 29, 2015
A bash script to download a twitch archive broadcast by its id number. needs axel and ffmpeg.
View twitch-downloader
#!/bin/bash
ID=$1
DATA="$(curl -silent http://api.justin.tv/api/broadcast/by_archive/$ID.xml?onsite=true)"
URLs="$(echo $DATA | grep -io 'http.*\.flv')"
NAME="$(echo $DATA | grep '<title>' | head -n1 | sed 's/<title>//g' | sed 's/<\/title>//g' | sed 's/^ *//g' | sed 's/ /\./g'| sed 's/\///g'|sed s/\'//g)"
mkdir "$NAME"
cd "$NAME"
View keybase.md

Keybase proof

I hereby claim:

  • I am m4p on github.
  • I am map (https://keybase.io/map) on keybase.
  • I have a public key whose fingerprint is A29C 1DC3 42BC 4B0F 20AD B653 8A14 3302 7195 C1BE

To claim this, I am signing this object: