Skip to content

Instantly share code, notes, and snippets.

@svpino
svpino / llama2-monsterapis.py
Last active August 14, 2023 17:36
Llama 2 - MonsterAPIs.
import requests
import json
from time import sleep
API_KEY = "INSERT YOUR API KEY HERE"
AUTHORIZATION = "INSERT YOUR AUTHORIZATION TOKEN HERE"
url = "https://api.monsterapi.ai/apis/add-task"
fetch_url = "https://api.monsterapi.ai/apis/task-status"
@mdeora
mdeora / mp3tomp4.sh
Created June 20, 2023 11:02 — forked from kates/mp3tomp4.sh
convert mp3 to mp4 with image loop using ffmpeg
ffmpeg -loop 1 -i logo.jpg -i source.mp3 -c:a libmp3lame -c:v libx264 -b:a 128k -shortest output.mp4
@wnqueiroz
wnqueiroz / Dockerfile
Created September 24, 2022 01:24
An efficient Dockerfile to build an image with NestJS with just the production dependencies
FROM node:16.17-alpine as builder
WORKDIR /usr/src/app
ARG NODE_ENV=production
ENV NODE_ENV=${NODE_ENV}
COPY package*.json ./
RUN npm i -g @nestjs/cli \
@luizomf
luizomf / upscale_1080p_to_4k_using_ffmpeg.md
Last active April 13, 2024 16:16
Upscale 1080p to 4k using ffmpeg

Upscale 1080p to 4k using ffmpeg

Just use the command below:

ffmpeg -i INPUT_FILE \
  -vf scale=3840x2160:flags=lanczos \
  -c:v libx264 \
  -crf 13 \
 -c:a aac -b:a 512k \
@mdeora
mdeora / copydb_all_tables_mysqli.php
Last active June 1, 2018 20:07
Copy all tables from one database to another database using php code
<?php
$dblink1=mysqli_connect('[server ip1]', '[username]', '[password]'); // connect server 1
mysqli_select_db($dblink1,'[db name]'); // select database 1
$dblink2=mysqli_connect('[server ip2]', '[username]', '[password]'); // connect server 2
mysqli_select_db($dblink2,'[db name]'); // select database 2
$tables = mysqli_fetch_array(mysqli_query($dblink1,"SHOW TABLES "));
@kates
kates / mp3tomp4.sh
Created May 13, 2017 15:36
convert mp3 to mp4 with image loop using ffmpeg
ffmpeg -loop 1 -i logo.jpg -i source.mp3 -c:a libmp3lame -c:v libx264 -b:a 128k -shortest output.mp4
@mklimek
mklimek / FrameVideoViewExample.java
Last active April 23, 2019 15:48
frame-viedo-view simple usage with possibility to manipulate MediaPlayer basic actions
import android.app.Activity;
import android.content.Intent;
import android.media.MediaPlayer;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import com.mklimek.framevideoview.FrameVideoView;
import com.mklimek.framevideoview.FrameVideoViewListener;
@JoeyBodnar
JoeyBodnar / gist:7be323b066058667851b
Created March 28, 2016 05:51
Video Loading/Caching with AVAssetResourceLoader
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
VideoCell *videoCell = (VideoCell *)[self.tableView dequeueReusableCellWithIdentifier:@"VideoCell"];
NSString *urlString = @"streaming://download.wavetlan.com/SVV/Media/HTTP/MOV/ConvertedFiles/MediaCoder/MediaCoder_test11_36s_H263_VBR_590kbps_176x144_25fps_MPEG1Layer3_CBR_160kbps_Stereo_22050Hz.mov";
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0ul);
// Configure Video Cell Here:
NSURL *url = [NSURL URLWithString:urlString];
videoCell.contentView.backgroundColor = [UIColor clearColor];
videoCell.backgroundColor = [UIColor clearColor];
@muresan
muresan / mysql_tuning_parameters
Created November 10, 2015 13:51
MySQL tunning from a persentation
All the changes that are fit to print. Droppin’ Mo’ Science 52 All Your IOPS Are Belong To Us: Ernie Souhrada, Database Engineer @ Pinterest - Percona Live MySQL Conference & Expo 2015 Full list of customizations / changes deployed:
-  Linux kernel 3.18.7
-  irqbalance 1.0.8
-  RPS enabled
-  Jemalloc instead of Glibc
-  Disk IO scheduler = noop
-  XFS + 64K RAID block size
-  Mount options: -  noatime,nobarrier,discard,inode64,logbsize=256k
-  my.cnf changes:
innodb_max_dirty_pages_pct = 75
from flask import Flask
from flask import request
import simplejson as json
from decimal import Decimal
import numpy as np
import os
import sys