Skip to content

Instantly share code, notes, and snippets.

View nareshdb's full-sized avatar
🎯
Focusing

Naresh D Bhadresha nareshdb

🎯
Focusing
  • Ahmedabad
View GitHub Profile
@nareshdb
nareshdb / compression.swift
Created October 22, 2019 11:35 — forked from jaumevn/compression.swift
Video Compression in Swift
func compress(videoPath : String, exportVideoPath : String, renderSize : CGSize, completion : (Bool) -> ()) {
let videoUrl = NSURL(fileURLWithPath: videoPath)
if (!existsFileAtUrl(videoUrl)) {
completion(false)
return
}
let videoAssetUrl = AVURLAsset(URL: videoUrl, options: nil)
@nareshdb
nareshdb / gist:6fa9b7a2a11f1b11ac7f52c2d9dfa097
Last active April 12, 2019 05:35
Adding components to URL, use this method instead of adding by yourself by appending string
extension URL {
@discardableResult
func append(_ queryItem: String, value: String?) -> URL {
guard var urlComponents = URLComponents(string: absoluteString) else { return absoluteURL }
// create array of existing query items
var queryItems: [URLQueryItem] = urlComponents.queryItems ?? []
// C++ program to find the shortest path between
// a given source cell to a destination cell.
#include <bits/stdc++.h>
using namespace std;
#define ROW 18
#define COL 20
//to store matrix cell cordinates
struct Point
{
@nareshdb
nareshdb / Foo4.java
Created December 2, 2016 03:14
Foo4
import java.util.*;
class Foo4{
public static void main(){
int mat[18][20] =
{
import java.util.*;
class Foo3{
public static void main(String args[]){
int[] l = {4,3,2,1};
answer(l);
package com.google.challenges;
import java.util.*;
public class Answer {
public static int answer(int src, int dest) {
class cell{
public int x,y,steps;
public boolean mask;
@nareshdb
nareshdb / hello.swift
Created October 9, 2016 03:41
Hello world
var x: String = "Hello World"
print(x)