Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.
brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus| import random | |
| import time | |
| def random_int64(): | |
| '''Generate a random 64-bit signed integer, with timestamp embedded in the higher 42 bits.''' | |
| CUSTOM_EPOCH = 1735689600 # 2025/01/01 00:00:00 UTC | |
| HIGH_42BIT_MASK = 0x7FFFFFFFFFC00000 # hex((2 ** 41 - 1) << 22) | |
| LOW_22BIT_MASK = 0x3FFFFF # hex(2 ** 22 - 1) |
| // SPDX-License-Identifier: MIT | |
| pragma solidity ^0.8.4; | |
| import "@openzeppelin/contracts@4.7.3/token/ERC721/ERC721.sol"; | |
| import "@openzeppelin/contracts@4.7.3/access/Ownable.sol"; | |
| import "@openzeppelin/contracts@4.7.3/utils/Counters.sol"; | |
| contract MyToken is ERC721, Ownable { | |
| using Counters for Counters.Counter; |
| const express = require('express'); | |
| const line = require('@line/bot-sdk'); | |
| const request = require('request'); | |
| const CHANNEL_ACCESS_TOKEN = 'YOUR_CHANNEL_ACCESS_TOKEN'; | |
| const CHANNEL_SECRET = 'YOUR_CHANNEL_SECRET'; | |
| const OPENAI_API_KEY = 'YOUR_OPENAI_API_KEY'; | |
| // 建立 LINE Bot 物件 | |
| const config = { |
| <?php | |
| // Server file | |
| class PushNotifications { | |
| // (Android)API access key from Google API's Console. | |
| private static $API_ACCESS_KEY = 'AIzaSyDG3fYAj1uW7VB-wejaMJyJXiO5JagAsYI'; | |
| // (iOS) Private key's passphrase. | |
| private static $passphrase = 'joashp'; | |
| // (Windows Phone 8) The name of our push channel. | |
| private static $channelName = "joashp"; |
| #!/usr/bin/env python3 | |
| import math | |
| # >> Discrete Fourier transform for sampled signals | |
| # x [in]: sampled signals, a list of magnitudes (real numbers) | |
| # yr [out]: real parts of the sinusoids | |
| # yi [out]: imaginary parts of the sinusoids | |
| def dft(x): | |
| N, yr, yi = len(x), [], [] |
| #!/usr/bin/env python | |
| """ | |
| Extract title from PDF file. | |
| Depends on: pyPDF, PDFMiner. | |
| Usage: | |
| find . -name "*.pdf" | xargs -I{} pdftitle -d tmp --rename {} |
| // Run from the dev tools console of any Youtube video | |
| // Accurate as of October 28, 2016. Uses quality + video type for naming now, | |
| // prevents video urls being overwritten. | |
| // ES6 version | |
| const videoUrls = ytplayer.config.args.url_encoded_fmt_stream_map | |
| .split(',') | |
| .map(item => item | |
| .split('&') | |
| .reduce((prev, curr) => (curr = curr.split('='), |
| <?php | |
| public function postBounceOrComplaint(Request $request, Mailer $mailer){ | |
| Log::info($request->json()->all()); | |
| if($request->json('Type') == 'SubscriptionConfirmation'){ | |
| $client = new Client(); | |
| $client->get($request->json('SubscribeURL')); | |
| return response()->json(); |