Simple fibonacci number calculator.
Usage: fib nth Fibonacci number
<?php | |
// have to add that opening tag to get syntax highlighting... ¯\_(ツ)_/¯ | |
/** | |
* Prevent update notification for plugin | |
* http://www.thecreativedev.com/disable-updates-for-specific-plugin-in-wordpress/ | |
* Place in theme functions.php or at bottom of wp-config.php | |
*/ | |
function disable_plugin_updates( $value ) { |
#include <stdio.h> | |
static void | |
minmax(int height[], int n, int *min, int *max) { | |
int i; | |
*min = *max = height[0]; | |
for (i=1;i<n;i++) { | |
if (height[i] < *min) | |
*min = height[i]; | |
else if (height[i] > *max) |
Various Windows 10 Batch Files and Notes | |
- Notably for improving privacy on Windows 10 | |
- Some performance tweaks |
$ ffmpeg -i input.mp4 -vcodec h264 -acodec mp2 output.mp4 |
#!/bin/bash | |
# Setup Debian PXEinstall environment | |
export MYIP=10.66.6.1 # TODO: Setup this | |
export MYINTERFACE=$(netstat -ie | grep -B1 "$MYIP" | head -n1 | awk '{print $1}') | |
if [ -z "$MYINTERFACE" ] | |
then | |
echo "Setup ip $MYIP first" |
// | |
// KeyAwareView.swift | |
// | |
// Created by Stef Kors on 04/09/2023. | |
// | |
// source: https://onmyway133.com/posts/how-to-handle-keydown-in-swiftui-for-macos/ | |
// source: https://github.com/sindresorhus/KeyboardShortcuts/blob/main/Sources/KeyboardShortcuts/Key.swift | |
import SwiftUI | |
import Carbon.HIToolbox |
By using Google Form's script editor, you can call Slack webhooks when form submissions are made. You can use this script to do things like creating a live feedback form for taking questions from an audience or notifying your team when someone signs up for an event.
First, be sure you're collecting the email address in the form:
import 'dart:async'; | |
import 'package:flutter/material.dart'; | |
import 'package:sensors/sensors.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { |
# Simple FFMPEG scripts I use to convert videos or audios | |
# The ones with h264_nvenc codec only work with NVidia graphic cards. You also need to install the drives to use them | |
# The hevc_nvenc codec is pretty fast but the output file size is terrible. So I won't include that in. (Special thanks to Erfan Mojibi) | |
# The libx265 provides better quality to file size. So we can increase the crf in it (source: https://trac.ffmpeg.org/wiki/Encode/H.265#ConstantRateFactorCRF) | |
# The tag is provided by @alirezahabib | |
# Simple convert from webm to mp4. ACC audio codec at 128kb/s. Change 24 to change the quality (higher is worse) | |
ffmpeg -i in.webm -r 10 -vf "scale=-2:720" -c:v h264_nvenc -cq:v 24 -profile:v high -c:a aac -b:a 128k -strict experimental out.mp4 | |
ffmpeg -i in.webm -r 10 -vf "scale=-2:720" -c:v libx264 -crf 24 -c:a aac -b:a 128k -strict experimental out.mp4 | |
ffmpeg -i in.webm -r 10 -vf "scale=-2:720" -c:v libx265 -crf 28 -c:a aac -b:a 128k -tag:v hvc1 -strict experimental out.mp4 |