Skip to content

Instantly share code, notes, and snippets.

@nattybear
nattybear / foldM.md
Last active November 16, 2020 10:13
Learn You a Haskell for Great Good 14장 foldM

이 글은 책 Learn You a Haskell for Great Good을 읽고 정리한 것입니다.

foldM

함수 foldl의 모나드 버전은 foldM이다. foldl의 타입은 아래와 같다.

foldl :: (a -> b -> a) -> a -> [b] -> a
@qdm12
qdm12 / README.md
Last active May 11, 2025 10:51
Wireguard and iptables restrictions for multiple users

Wireguard and iptables restrictions for multiple users

If you don't know what Wireguard is, well, you should. It's fast, easy to setup and highly configurable. We will configure Wireguard for multiple users with various restrictions using iptables.

Assumptions

This should fit most setups (not mine though 😉)

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jmurphyau
jmurphyau / download.sh
Created February 9, 2020 22:47
Download HLS Stream with FFmpeg
#this
ffmpeg -loglevel debug -f hls -referer 'https://10play.com.au/live' -user_agent 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/82.0.4050.0 Safari/537.36' -f hls -i "https://manifest.prod.boltdns.net/manifest/v1/hls/v4/aes128/2199827728001/6bd7fe89-1f2f-42d0-b7a5-c676791a0d83/10s/master.m3u8?fastly_token=NWUzZDliOGZfNTJhZjJhN2IxMzQ5OTdjNGVkYmEzODkwNjYwZTYyMWY2ZmY1YjNmNGJkNWM3NjdiNDFiZmViNjczNzMwMmJlYQ%3D%3D" -c copy project5.mp4
# or this
ffmpeg -loglevel debug -f hls -referer 'https://10play.com.au/live' -user_agent 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/82.0.4050.0 Safari/537.36' -f hls -i "https://manifest.prod.boltdns.net/manifest/v1/hls/v4/aes128/2199827728001/6bd7fe89-1f2f-42d0-b7a5-c676791a0d83/10s/master.m3u8?fastly_token=NWUzZDliOGZfNTJhZjJhN2IxMzQ5OTdjNGVkYmEzODkwNjYwZTYyMWY2ZmY1YjNmNGJkNWM3NjdiNDFiZmViNjczNzMwMmJlYQ%3D%3D" -c copy -bsf:a aac_adtstoasc project3.mp4
@lukaselmer
lukaselmer / ExportOptions.plist
Created January 11, 2020 21:10
Create a Flutter .apk and .ipa file to upload it to Firebase App Distribution
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>method</key>
<string>ad-hoc</string>
<key>uploadBitcode</key>
<false/>
<key>uploadSymbols</key>
<true/>
@denniske
denniske / custom-solution.dart
Last active May 30, 2021 09:48
Flutter Modal bottom sheet will not overlap keyboard (Fixed)
import 'package:flutter/material.dart';
class CustomPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(),
floatingActionButton: FloatingActionButton(
onPressed: () {
showModalBottomSheet(
@theprojectsomething
theprojectsomething / index.js
Last active November 7, 2019 09:34
Firebase Cloud Functions: Multi-file setup
const functions = require('firebase-functions');
const path = require('path');
const glob = require('glob');
const ENDPOINT_FOLDER = './endpoints';
const DO_NOT_DEPLOY = /^(admin|a|debug|d)$/;
const IGNORE = /^(ignore|i)$/;
const BREAK_ON_ERROR = true;
const is = {
diff --git a/gstreamer-send/main.go b/gstreamer-send/main.go
index 3a2ab8c..df5df2a 100644
--- a/gstreamer-send/main.go
+++ b/gstreamer-send/main.go
@@ -27,8 +27,16 @@ func main() {
},
}
+ m := webrtc.MediaEngine{}
+ s := webrtc.SettingEngine{}
@MarcinusX
MarcinusX / main.dart
Created March 21, 2019 19:36
Ripple effect transition
import 'package:flutter/material.dart';
import 'package:rect_getter/rect_getter.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Fab overlay transition',
@indongyoo
indongyoo / reduce+generator.js
Last active December 6, 2018 07:44
reduce+generator
function reduce(f, acc, iter) {
if (arguments.length == 2) {
iter = acc[Symbol.iterator]();
acc = iter.next().value;
}
for (const a of iter) acc = f(acc, a);
return acc;
}
reduce((a, b) => a + b, function*() {