Skip to content

Instantly share code, notes, and snippets.

View dharmeshrchauhan's full-sized avatar

Dharmesh Chauhan dharmeshrchauhan

  • Ahmedabad, India
View GitHub Profile
@dharmeshrchauhan
dharmeshrchauhan / cropvideo
Created August 11, 2020 09:10
swift code for cropVideo (swift 5)
func cropVideo(_ inputFileUrl: URL, outputFileUrl: URL, rect: CGRect, completion: @escaping () -> Void)
{
// Get input clip
//let videoAsset: AVAsset = AVAsset( url: inputFileUrl )
let videoAsset: AVURLAsset = AVURLAsset(url: inputFileUrl, options: [AVURLAssetPreferPreciseDurationAndTimingKey: true])
let clipVideoTrack = videoAsset.tracks( withMediaType: AVMediaType.video ).first! as AVAssetTrack
let videoComposition: AVMutableVideoComposition = AVMutableVideoComposition()
videoComposition.frameDuration = clipVideoTrack.minFrameDuration
@dharmeshrchauhan
dharmeshrchauhan / gist:37455ca6a0f55aea4326cf57b484b3c1
Created July 14, 2020 07:36
How to find webrtc stable source code.
83.0.4103.84
How webrtc source Code was identified:
- WebRTC project doesn't mark its release as beta or stable. In fact there isn't any release marked in WebRTC repository.
- WebRTC is released with the release of Chromium. Chromium release builds are same as Chrome'
Reference chrome release: Chrome 83.0.4103.63 (IOS app version as on 24 May 2020)
- It implies Milestone 83 (https://www.chromium.org/developers/version-numbers)
- Based on milestone, identified Chromium branch and WebRTC git branch with these steps: https://groups.google.com/forum/#!msg/discuss-webrtc/JR7fsoEuqw0/egT626FSAgAJ. Branch 4103
- Chromium branch: 4103, WebRTC branch: 4103
@dharmeshrchauhan
dharmeshrchauhan / hosting-on-github.md
Created May 27, 2020 23:58 — forked from TylerFisher/hosting-on-github.md
Basic steps for hosting on Github

Hey there, apparently people are still using this Gist from 2013! It's out of date! Consult the Github docs.

Steps for Hosting a Website on GitHub

  1. Create a GitHub account on github.com.
  2. Download either [GitHub for Mac][1] or [GitHub for Windows][2], depending on your operating system. Open the app and log in using the account you just created.
  3. (On Mac): After you login, click advanced and make sure that your name and email are correct. Then, click "Install Command Line Tools", just in case you want to start using the command line later in life.
  4. Create a new repository in your GitHub application. Name it your-username.github.io. The name is very important. Note the folder that GitHub is saving the repository to. Make sure the "Push to GitHub?" box is checked.
  5. Move your website's files into the folder that GitHub just created when you made the repository. IMPORTANT: Your homepage HTML file must be called "index.html", and it must exist in the top-level
@dharmeshrchauhan
dharmeshrchauhan / gist:86d895c156b67095ab4194f7c6bae297
Created September 22, 2017 11:39 — forked from steipete/ios-xcode-device-support.sh
Using iOS 10.3 devices with Xcode 8.2.1
// The trick is to link the DeviceSupport folder from the beta to the stable version.
// Updated on Jan 24th, 2017 for Xcode 8.3b1
ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/10.3\ \(14E5230d\)/ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
// Then restart Xcode and reconnect your devices. You will need to do that for every beta of future iOS versions
// sudo needed if you run the Mac App Store version. Always download the dmg instead... you'll thank me later :)
@dharmeshrchauhan
dharmeshrchauhan / gist:3d56e7636f94b1e7690795bb35ac9bd5
Created November 3, 2016 06:33
DL4J Android PosUimaTokenizerFactrory error
11-03 11:52:16.947 2943-2943/in.jaaga.newtestapplication E/AndroidRuntime: FATAL EXCEPTION: main
Process: in.jaaga.newtestapplication, PID: 2943
java.lang.NoClassDefFoundError: Failed resolution of: Ljava/beans/Introspector;
at org.apache.uima.impl.UIMAFramework_impl._initialize(UIMAFramework_impl.java:173)
at org.apache.uima.UIMAFramework.<clinit>(UIMAFramework.java:1310)
at org.apache.uima.fit.factory.TypeSystemDescriptionFactory.createTypeSystemDescription(TypeSystemDescriptionFactory.java:103)
at org.apache.uima.fit.factory.AnalysisEngineFactory.cr