This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Arrays; | |
import java.util.function.Function; | |
import java.util.function.IntConsumer; | |
public class HelloWorld{ | |
// https://blogs.oracle.com/javamagazine/behind-the-scenes-how-do-lambda-expressions-really-work-in-java | |
// javac .\HelloWorld.java | |
// javap -p -c HelloWorld$1 | |
String sum=""; | |
public static void main(String []args){ | |
new HelloWorld().main(); //comment then uncomment below comments also |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import alpaca_trade_api as tradeapi | |
import time | |
import datetime | |
from datetime import timedelta | |
from pytz import timezone | |
tz = timezone('EST') | |
import numpy as np | |
import pandas as pd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
import java.util.List; | |
import redis.clients.jedis.Jedis; | |
public class RedisJava { | |
public static void main(String[] args) { | |
// Connecting to Redis server on localhost | |
Jedis jedis = new Jedis("localhost", 8083); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DefaultExceptionHandler implements Runnable { | |
public void run() { | |
//throw new RuntimeException(); | |
new Test().err(); | |
} | |
public static void main(String[] args) { | |
Thread thread = new Thread(new DefaultExceptionHandler()); | |
thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#CODE | |
#Generate root password | |
import random, string | |
password = ''.join(random.choice(string.ascii_letters + string.digits) for i in range(20)) | |
#Download ngrok | |
! wget -q -c -nc https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip | |
! unzip -qq -n ngrok-stable-linux-amd64.zip | |
#Setup sshd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import requests | |
import json | |
SLACK_WEBHOOK= os.environ.get("SLACK_WEBHOOK") | |
def send_message(messages, channel="abhishek", username="beast"): | |
""" | |
:param messages: list of texts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def plot_eli5_top_explanations( | |
model: Model, | |
image: np.array, | |
class_names_mapping: Dict[int, str], | |
top_preds_count: int = 3, | |
fig_name: Optional[str] = None | |
) -> None: | |
image_columns = 3 | |
image_rows = math.ceil(top_preds_count / image_columns) |
Here I have 2 methods for running portainer on windows, a quick, preferred method only requiring a fairly recent version of docker, or a more complicated method to try if that does not work.
This setup will let you run Portainer on windows by using the docker.for.win.localhost endpoint.
Please note:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
DESCRIPTION | |
----------- | |
Use NodeJS to read RFID ids through the USB serial stream. Code derived from this forum: | |
http://groups.google.com/group/nodejs/browse_thread/thread/e2b071b6a70a6eb1/086ec7fcb5036699 | |
CODE REPOSITORY | |
--------------- | |
https://gist.github.com/806605 |
NewerOlder