Skip to content

Instantly share code, notes, and snippets.

View gggauravgandhi's full-sized avatar
🤓
Something can always be better, nothing is ever complete 🚀

Gaurav gggauravgandhi

🤓
Something can always be better, nothing is ever complete 🚀
View GitHub Profile
@gggauravgandhi
gggauravgandhi / neofetch.config
Last active June 9, 2020 09:29
Neofetch custom config to print with loop, .config/neofetch/config.conf
# See this wiki page for more info:
# https://github.com/dylanaraps/neofetch/wiki/Customizing-Info
print_info() {
#info title
#info underline
info "OS" distro
#info "Host" model
info "Kernel" kernel
info "Uptime" uptime
@gggauravgandhi
gggauravgandhi / neofetch_loop.sh
Last active June 9, 2020 08:50
Neofetch print color output every x seconds with buffer using while loop
while true; do neofetch --backend off > /tmp/neofetch_file; clear; cat /tmp/neofetch_file; sleep 60; done
# or
watch -ctn 1 'neofetch | sed "s/25[hl]//g;s/7[hl]//"'
@smidgedy
smidgedy / SimpleHTTPServerWithUpload.py
Last active June 24, 2024 07:16 — forked from UniIsland/SimpleHTTPServerWithUpload.py
Simple Python Http Server with Upload
#!/usr/env python3
########################################################################
#
# Simple HTTP server that supports file upload for moving data around
# between boxen on HTB. Based on a gist by bones7456, but mangled by me
# as I've tried (badly) to port it to Python 3, code golf it, and make
# It a little more robust. I was also able to strip out a lot of the
# code trivially because Python3 SimpleHTTPServer is a thing, and the
# cgi module handles multipart data nicely.
#
@spunkypanda
spunkypanda / evolutionOfPromise.js
Last active June 14, 2019 11:46
Evolution of Promise syntax
const originalFunctionWithPromise = (num) => new Promise((resolve, reject) => {
try {
if (typeof num !== 'number') {
return reject(new Error('Invalid input'));
}
return resolve(5 * num);
} catch (err) {
return reject(err);
}
});
@jabczyk
jabczyk / knick-knack-bot.js
Last active July 6, 2021 15:45
Consumes all knick-knacks in Your steam inventory
/**
* Knick Knack Steam Bot
*
* Consumes all knick-knacks in Your steam inventory
*
* - Go to https://steamcommunity.com/my/inventory#753_6
* - Wait for inventory to load
* - Press F12
* - Paste the code in console tab
*
@whizzzkid
whizzzkid / XPS-15 9560 Getting Nvidia To Work on KDE Neon
Last active December 3, 2022 15:43
[XPS 15 Early 2017 9560 kabylake] Making Nvidia Drivers + (CUDA 8 / CUDA 9 / CUDA 9.1) + Bumblebee work together on linux ( Ubuntu / KDE Neon / Linux Mint / debian )
# Instructions for 4.14 and cuda 9.1
# If upgrading from 4.13 and cuda 9.0
$ sudo apt-get purge --auto-remove libcud*
$ sudo apt-get purge --auto-remove cuda*
$ sudo apt-get purge --auto-remove nvidia*
# also remove the container directory direcotory at /usr/local/cuda-9.0/
# Important libs required with 4.14.x with Cuda 9.X
$ sudo apt install libelf1 libelf-dev
@kaeff
kaeff / dl-lesson.sh
Created November 18, 2016 09:28
Download an egghead.io lesson using youtube-dl
#!/bin/bash
# Usage: dl-lession.sh https://egghead.io/courses/react-fundamentals
let n=1
for link in $(curl -s $1 | pup '.series-lessons-list a attr{href}'); do
filename=$(echo $link | sed "s/https:\/\/egghead.io\/lessons\///g" | sed "s/\?.*$//g")
filename_numbered=$(echo "$n $filename" | awk '{ printf "%02i-%s.mp4\n", $1, $2 }')
youtube-dl -o "$filename_numbered" "$link"
let n++
done
@soply
soply / disp_multiple_images.py
Last active November 22, 2024 04:48
Plot multiple images with matplotlib in a single figure. Titles can be given optionally as second argument.
import matplotlib.pyplot as plt
import numpy as np
def show_images(images, cols = 1, titles = None):
"""Display a list of images in a single figure with matplotlib.
Parameters
---------
images: List of np.arrays compatible with plt.imshow.
@fchollet
fchollet / classifier_from_little_data_script_1.py
Last active February 26, 2025 01:37
Updated to the Keras 2.0 API.
'''This script goes along the blog post
"Building powerful image classification models using very little data"
from blog.keras.io.
It uses data that can be downloaded at:
https://www.kaggle.com/c/dogs-vs-cats/data
In our setup, we:
- created a data/ folder
- created train/ and validation/ subfolders inside data/
- created cats/ and dogs/ subfolders inside train/ and validation/
- put the cat pictures index 0-999 in data/train/cats
@baraldilorenzo
baraldilorenzo / readme.md
Last active January 14, 2025 11:07
VGG-16 pre-trained model for Keras

##VGG16 model for Keras

This is the Keras model of the 16-layer network used by the VGG team in the ILSVRC-2014 competition.

It has been obtained by directly converting the Caffe model provived by the authors.

Details about the network architecture can be found in the following arXiv paper:

Very Deep Convolutional Networks for Large-Scale Image Recognition

K. Simonyan, A. Zisserman