For an framework to be compatible with various devices it has to be compiled for them specifically, This script does those tasks in single shot.
- Select Target
const { google } = require("googleapis"); | |
const fs = require("fs"); | |
// You need to go to Google Cloud console (console.cloud.google.com), then APIs | |
// & Services -> Credentials. There, create a new service account (or reuse | |
// existing if you have one). Click on a service account, go to Keys, and create | |
// a new key, and download JSON for it. You'll use path to that JSON for | |
// SERVICE_ACCOUNT_FILE var. | |
// | |
// Then, go to Google Play Console, then "Users and Permissions" on the left |
artistImageUrlList = [] | |
print('Total artists streamed:', len(uniqueArtistUriList)) | |
for uri in range(49): | |
spotifyUrl = requests.get('https://open.spotify.com/artist/' + | |
str(uniqueArtistUriList[uri])) | |
spoifyHtmlData = str(soup(spotifyUrl.text, 'html.parser')) | |
spoifyHtmlData = spoifyHtmlData.split('<') | |
artistName = spoifyHtmlData[5].split('>') | |
artistName = artistName[1].split('|') | |
artistApiResults = requests.get('https://api.spotify.com/v1/search', |
import winston from 'winston'; | |
import morgan from 'morgan'; | |
import json from 'morgan-json'; | |
/* WINSTON */ | |
const filterLevel = level => winston.format(info => info.level === level ? info : undefined)(); | |
const logger = winston.createLogger({ | |
levels: { error: 0, warn: 1, info: 2, debug: 3, http: 4 }, | |
transports: [ |
#!/bin/bash | |
ffmpeg -y -i "$f" -vn -c:a libfdk_aac -b:a 128k "audio/$(basename $f .mp4).m4a" | |
afconvert -f caff -d opus -b 8000 "audio/$(basename $f .mp4).m4a" "opus/$(basename $f .mp4).caf" |
extension UIViewController { | |
var compatibleSafeInsets: UIEdgeInsets { | |
if #available(iOS 11, *) { | |
return view.safeAreaInsets | |
} else { | |
return UIEdgeInsetsMake(topLayoutGuide.length, 0, bottomLayoutGuide.length, 0) | |
} | |
} | |
} |
proxy_http_version 1.1; | |
proxy_set_header Connection ""; | |
https://gist.github.com/miguelmota/6912559 | |
# The upstream module is the link between Node.js and Nginx. | |
# Upstream is used for proxying requests to other servers. | |
# All requests for / get distributed between any of the servers listed. | |
upstream helloworld { | |
# Set up multiple Node.js webservers for load balancing. | |
# max_fails refers to number of failed attempts | |
# before server is considered inactive. |
This basic guide supports Ubuntu Xenial Xerus 16.04 and will enable several external encoding and decoding libraries: libfaac (AAC encoder), libfdk-aac (AAC encoder), libmp3lame (MP3 encoder), libopencore-amr (AMR encoder/decoder), librtmp (for additional RTMP protocols), libtheora (Theora encoder), libvorbis (Vorbis encoder), libvpx (VP8 encoder/decoder), and libx264 (H.264 encoder). These are optional and may be omitted if desired. This guide will also install many filters (see the filter list in the [Filtering Guide][1].
Note: Copy and paste the whole code box for each step.
- (void)fixVideoUrl:(NSURL *)url completion:(void (^)(NSURL *outputUrl))completion { | |
// output file | |
NSString* docFolder = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject]; | |
NSString* outputPath = [docFolder stringByAppendingPathComponent:@"output2.mov"]; | |
if ([[NSFileManager defaultManager] fileExistsAtPath:outputPath]) { | |
[[NSFileManager defaultManager] removeItemAtPath:outputPath error:nil]; | |
} | |
// input file | |
AVAsset* asset = [AVAsset assetWithURL:url]; |
extension Int { | |
func formatUsingAbbrevation () -> String { | |
let numFormatter = NSNumberFormatter() | |
typealias Abbrevation = (threshold:Double, divisor:Double, suffix:String) | |
let abbreviations:[Abbrevation] = [(0, 1, ""), | |
(1000.0, 1000.0, "K"), | |
(100_000.0, 1_000_000.0, "M"), | |
(100_000_000.0, 1_000_000_000.0, "B")] |