Skip to content

Instantly share code, notes, and snippets.

View eclipsed-ninja's full-sized avatar

Ashish Saxena eclipsed-ninja

View GitHub Profile
false
Everybody goes crazy on online ecommerce discounts !!, What if I offered you a better deal.
Here at REAK E-commerce store, we have a very unusual discount going on.
We allow you to remove a single digit from the price of a commodity, and whatever's left will be
what you're going to pay.
It's your job to come up with an automated solution to calculate the lowest price one needs to pay.
Input Params :
1. # of Items -> (int) = Number of items you added to your cart
@eclipsed-ninja
eclipsed-ninja / scalableLayout.qml
Created January 31, 2022 14:37
Scalable Layout Qt
import QtQuick
import QtQuick.Window
import QtQuick.Layouts
Window {
id: root
width: 640
height: 480
visible: true
title: qsTr("Hello World")
@eclipsed-ninja
eclipsed-ninja / layouts.qml
Created January 31, 2022 11:15
Layouts v2
import QtQuick
import QtQuick.Window
import QtQuick.Layouts
Window {
width: 100
height: 480
visible: true
title: qsTr("Hello World")
@eclipsed-ninja
eclipsed-ninja / layouts.qml
Created January 31, 2022 10:55
Demonstration of Layouts
import QtQuick
import QtQuick.Window
import QtQuick.Layouts
Window {
width: 640
height: 480
visible: true
title: qsTr("Hello World")
@eclipsed-ninja
eclipsed-ninja / multifileupload.go
Created August 13, 2021 07:08
golang multiple file upload
package main
import (
"net/http"
"fmt"
"io/ioutil"
"text/template"
)
func main(){
@eclipsed-ninja
eclipsed-ninja / transcode-vaapi.sh
Last active July 2, 2021 10:32
Transcoding Sample
/volume1/@appstore/ffmpeg/bin/ffmpeg -y\
-hwaccel vaapi -hwaccel_output_format vaapi\
-i "/volume1/Transcoding testing/Source/ABC7 News 5 00AM (2012)/Season 2021/ABC7 News 5 00AM (2012) - 2021-03-07 05 00 00 - ABC7 News 5 00AM.ts"\
-c:a aac -ac 2 -ab 128k\
-c:v h264_vaapi\
-x264opts 'keyint=24:min-keyint=24:no-scenecut'\
-b:v 800k -maxrate 800k -bufsize 500k\
-vf "scale_vaapi=w=960:h=540"\
"/volume1/Transcoding testing/Source/ABC7 News 5 00AM (2012)/Season 2021/trial-2.mp4"
@eclipsed-ninja
eclipsed-ninja / fileupload.go
Created January 19, 2021 12:46
Multifile upload in go
func Test(w http.ResponseWriter, r *http.Request) {
utility.View.ExecuteTemplate(w, "fileupload", nil)
if(r.Method == "POST"){
r.ParseMultipartForm(10 << 20)
files := r.MultipartForm.File["files"]
for _, handler := range files {
f, err := handler.Open()
if err != nil {
fmt.Println("Error Retrieving the File")
fmt.Println(err)
@eclipsed-ninja
eclipsed-ninja / reakCLA.md
Created December 21, 2020 18:16
REAK CLA

REAK INFOTECH LLP Individual Contributor License Agreement

Thank you for your interest in contributing to open source software projects (“Projects”) made available by REAK INFOTECH LLP or its affiliates (“REAK”). This Individual Contributor License Agreement (“Agreement”) sets out the terms governing any source code, object code, bug fixes, configuration changes, tools, specifications, documentation, data, materials, feedback, information or other works of authorship that you submit or have submitted, in any form and in any manner, to REAK in respect of any of the Projects (collectively “Contributions”). If you have any questions respecting this Agreement, please contact hello@reak.in.

You agree that the following terms apply to all of your past, present and future Contributions. Except for the licenses granted in this Agreement, you retain all of your right, title and interest in and to your Contributions.

Copyright License. You hereby grant, and agree to grant, to REAK a non-exclusive, perpetua

@eclipsed-ninja
eclipsed-ninja / concurrency.py
Last active November 24, 2020 06:00
Python Concurrency Selenium
import time
import requests
import concurrent.futures
from selenium import webdriver
from threading import Lock
driver = webdriver.Firefox(executable_path=r'./geckodriver')
MAXWORKERS = 4
lock = Lock()
def pages(page_url, timeout=10):