Skip to content

Instantly share code, notes, and snippets.

View MaxySpark's full-sized avatar
🐧
JS in Front JS in Back

BHARGAB MaxySpark

🐧
JS in Front JS in Back
View GitHub Profile
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=/home/maxyspark/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
# ZSH_THEME="agnoster"
@MaxySpark
MaxySpark / mongoose.js
Last active July 16, 2018 20:56
Simple Mongoose Connection (MongoDB) NodeJS
var mongoose = require('mongoose');
//Set up default mongoose connection
var dbName = 'chatapp';
var collectionName = 'test';
var mongoDB = 'mongodb://127.0.0.1:27017/'+dbName;
mongoose.connect(mongoDB,{ useNewUrlParser: true });
// Get Mongoose to use the global promise library
mongoose.Promise = global.Promise;
//Get the default connection
Section "InputClass"
Identifier "evdev touchscreen catchall"
MatchIsTouchscreen "off"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
EndSection
@MaxySpark
MaxySpark / debian.sh
Last active May 16, 2019 18:44
DEBIAN
# max min left
gsettings set org.gnome.desktop.wm.preferences button-layout 'close,minimize,maximize:'
# vpn
sudo apt install openvpn network-manager-openvpn network-manager-openvpn-gnome curl bc
sudo apt install geoip-bin geoip-database geoip-database-extra
sudo apt install geoip-bin geoip-database-contrib
sudo apt-get install expect
#include<EEPROM.h>
#include<LiquidCrystal.h>
LiquidCrystal lcd(13,12,11,10,9,8);
#include <SoftwareSerial.h>
SoftwareSerial fingerPrint(2, 3);
#include <Wire.h>
#include <RTClib.h>
RTC_DS1307 rtc;
from random import *
n = int(1e5)
maxv = int(1e9)
print(n)
print(" ".join([str(randrange(maxv)) for _ in range(n)]))
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install python-certbot-nginx
sudo echo "deb http://old-releases.ubuntu.com/ubuntu/ zesty main" | sudo tee -a /etc/apt/sources.list
sudo echo "deb-src http://old-releases.ubuntu.com/ubuntu/ zesty main" | sudo tee -a /etc/apt/sources.list
sudo echo "deb http://old-releases.ubuntu.com/ubuntu/ zesty-updates main" | sudo tee -a /etc/apt/sources.list
sudo echo "deb-src http://old-releases.ubuntu.com/ubuntu/ zesty-updates main" | sudo tee -a /etc/apt/sources.list
sudo echo "deb http://old-releases.ubuntu.com/ubuntu/ zesty universe" | sudo tee -a /etc/apt/sources.list
sudo echo "deb-src http://old-releases.ubuntu.com/ubuntu/ zesty universe" | sudo tee -a /etc/apt/sources.list
sudo echo "deb http://old-releases.ubuntu.com/ubuntu/ zesty-updates universe" | sudo tee -a /etc/apt/sources.list
sudo echo "deb-src http://old-releases.ubuntu.com/ubuntu/ zesty-updates universe" | sudo tee -a /etc/apt/sources.list
sudo echo "deb http://old-releases.ubuntu.com/ubuntu zesty-security main" | sudo tee -a /etc/apt/sources.list
sudo echo "deb-src http://old-rele
import java.util.*;
public class kmean {
public static void main(String[] args) {
int[] dataset = { 2,3,4,10,11,12,20,25,30 };
ArrayList<Integer> c1 = new ArrayList<Integer>();
ArrayList<Integer> c2 = new ArrayList<Integer>();
function getRandomColor() {
var letters = '0123456789ABCDEF';
var color = '#';
for (var i = 0; i < 6; i++) {
color += letters[Math.floor(Math.random() * 16)];
}
return color;
}