We need to create a virtual env for our app to run in: More Here Run this command in whatever folder you want to create your venv folder
python -m venv ./venv
#!/usr/bin/env python | |
""" | |
Fast duplicate file finder. | |
Usage: duplicates.py <folder> [<folder>...] | |
Based on https://stackoverflow.com/a/36113168/300783 | |
Modified for Python3 with some small code improvements. | |
""" | |
import os | |
import sys |
#!/bin/bash | |
git clone https://github.com/kornelski/pngquant | |
cd pngquant | |
git checkout -b 2.12.3 | |
sudo yum install libpng-devel -y | |
make | |
sudo make install |
We need to create a virtual env for our app to run in: More Here Run this command in whatever folder you want to create your venv folder
python -m venv ./venv
import {CustomError} from "./error/custom-error.interface"; | |
require('dotenv').config(); | |
import {RequestHandler} from 'express'; | |
import {MongoClient} from 'mongodb'; | |
let client: MongoClient; | |
const connectToClientIfDropped: () => Promise<void> = async () => { | |
if (client && client.isConnected()) { |
This is a way to build Python 3.7 from source and temporarily install it in Amazon Linux 2 without
overwriting the system Python and without interfering with the Python in amazon-linux-extras
.
At the time of this writing, Amazon Linux 2 offers Python 2.7.14 and (through the extras) Python 3.6.2, but Python 3.7.0 was just released.
from PIL import Image, ImageSequence | |
# Output (max) size | |
size = 320, 240 | |
# Open source | |
im = Image.open("in.gif") | |
# Get sequence iterator | |
frames = ImageSequence.Iterator(im) |
// | |
// ViewController.swift | |
// CameraFilter | |
// | |
import UIKit | |
import AVFoundation | |
class ViewController: UIViewController, AVCaptureVideoDataOutputSampleBufferDelegate { | |
func processSampleBuffer(scale: Float, sampleBuffer: CMSampleBuffer, writerInput: AVAssetWriterInput) -> Bool { | |
guard let blockBuffer = CMSampleBufferGetDataBuffer(sampleBuffer) else { | |
return false | |
} | |
let length = CMBlockBufferGetDataLength(blockBuffer) | |
var sampleBytes = UnsafeMutablePointer<Int16>.allocate(capacity: length) | |
defer { sampleBytes.deallocate(capacity: length) } | |
guard checkStatus(CMBlockBufferCopyDataBytes(blockBuffer, 0, length, sampleBytes), message: "Copying block buffer") else { | |
return false |
[ | |
{ | |
"name": "Afghanistan", | |
"dial_code": "+93", | |
"code": "AF" | |
}, | |
{ | |
"name": "Aland Islands", | |
"dial_code": "+358", | |
"code": "AX" |
#import <AVFoundation/AVFoundation.h> | |
#import "Recorder.h" | |
@interface Recorder()<AVCaptureAudioDataOutputSampleBufferDelegate>{ | |
AVCaptureDevice *audioDevice; | |
AVCaptureDeviceInput *audioInput; | |
AVCaptureAudioDataOutput* _audioDataOutput; | |
dispatch_queue_t _captureQueue; | |
AVURLAsset *_asset; |