Skip to content

Instantly share code, notes, and snippets.

View rootAvish's full-sized avatar
🇮🇳

Avishkar Gupta rootAvish

🇮🇳
View GitHub Profile
@rnorth
rnorth / pure-theme.fish
Last active May 4, 2016 20:45 — forked from jonathanmarvens/pure-theme.fish
Pure themed prompt for Fish shell, with display of last command duration and time of day
###########################################
# Copyright (c) 2014 Jonathan Barronville #
# Minor tweaks by Richard North #
# License: MIT. #
###########################################
function fish_prompt
set last_command_status $status
echo ''
@syhw
syhw / dnn.py
Last active June 23, 2024 04:13
A simple deep neural network with or w/o dropout in one file.
"""
A deep neural network with or w/o dropout in one file.
License: Do What The Fuck You Want to Public License http://www.wtfpl.net/
"""
import numpy, theano, sys, math
from theano import tensor as T
from theano import shared
from theano.tensor.shared_randomstreams import RandomStreams
@dufferzafar
dufferzafar / MinDistArray.c
Last active August 29, 2015 13:58
Finding an array that is at minimum distance from a group of arrays.
# include <stdio.h>
# include <stdlib.h>
# include <time.h>
# include <math.h>
float distance(int *, int *, int);
void printArr(int *, int, int, char *);
void printMat(int **, int, int, char *);
int main(int argc, char const *argv[])
###########################################
# Copyright (c) 2014 Jonathan Barronville #
# License: MIT. #
###########################################
function fish_prompt
set last_command_status $status
echo ''
@juanplopes
juanplopes / rsa.py
Last active July 14, 2023 17:35
RSA by example
from random import randint
#----Step 1
# First, choose two random primes.
# In real world, they should be really big primes (hundreds of digits).
p, q = 41, 47
#----Step 2
# From them we have n=p*q and phi(n)=(p-1)*(q-1).
@raineorshine
raineorshine / mongo-cheat-sheet.js
Last active July 7, 2022 20:22
Cheat Sheet: MongoDB
/* COMMAND LINE */
mongod & // start mongo server on port 27017 by default
mongo mydb // launch mongo shell using the specified database
// importing & exporting
mongoimport -d mydb -c mycollection --jsonArray --file input.json
mongoimport -d mydb -c mycollection --headerline --type csv --file input.csv
mongoexport -d mydb -c mycollection --out output.json
/* MONGO SHELL */
@coolaj86
coolaj86 / how-to-publish-to-npm.md
Last active July 25, 2024 03:38
How to publish packages to NPM

Getting Started with NPM (as a developer)

As easy as 1, 2, 3!

Updated:

  • Aug, 08, 2022 update config docs for npm 8+
  • Jul 27, 2021 add private scopes
  • Jul 22, 2021 add dist tags
  • Jun 20, 2021 update for --access=public
  • Sep 07, 2020 update docs for npm version
@bellbind
bellbind / getscreenshot.c
Created July 1, 2009 13:33
[c][gtk][webkit]get screenshot PNG from web page
/*
* get screenshot PNG from web page
*
* build:
* FLAGS=`pkg-config --cflags --libs gtk+-x11-2.0 glib-2.0 webkit-1.0`
* gcc -Wall $FLAGS getscreenshot.c -o getscreenshot
*
* usage:
* /usr/bin/xvfb-run -s "-screen 0 1024x768x24" ./getscreenshot test.html
*