Skip to content

Instantly share code, notes, and snippets.

View AwsafAlam's full-sized avatar
👨‍💻
Eat. Sleep. Code.

Md Awsaf Alam AwsafAlam

👨‍💻
Eat. Sleep. Code.
View GitHub Profile
@AwsafAlam
AwsafAlam / docker_startup.sh
Last active April 26, 2021 12:10
docker installation script on instance startup
#!/bin/bash
# install latest version of docker the lazy way
curl -sSL https://get.docker.com | sh
# make it so you don't need to sudo to run docker commands
usermod -aG docker ubuntu
# install docker-compose
curl -L https://github.com/docker/compose/releases/download/1.21.2/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
{
"env": {
"browser": true,
"es6": true
},
"extends": "eslint:recommended",
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"""Recommendation module.
This module deals with using lightFM models in production and includes a
LightFm subclass which provides a predict_online method to use in API or
similar scenarios.
"""
import operator
from logging import getLogger
import numpy as np
@bradtraversy
bradtraversy / docker-help.md
Last active May 15, 2024 05:31
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

@mjohnsullivan
mjohnsullivan / TimerActivity.java
Created July 9, 2015 13:15
Example of how to create a long running timer service that survives activity destruction by moving to the foreground, and back to the background when a new activity bind to it.
//
// Copyright 2015 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
@debloper
debloper / bandwidth.js
Last active November 5, 2023 19:15
Determine client's connection speed with JavaScript
// Let's initialize the primitives
var startTime, endTime, fileSize;
// Set up the AJAX to perform
var xhr = new XMLHttpRequest();
// Rig the call-back... THE important part
xhr.onreadystatechange = function () {
// we only need to know when the request has completed
@adnbr
adnbr / simple-usart-commands.c
Last active September 22, 2022 07:01
Parsing simple USART commands on an AVR
/* Parsing simple USART commands
* -----------------------------
* For more information see
* http://www.adnbr.co.uk/articles/parsing-simple-usart-commands
*
* 996 bytes - ATmega168 - 16MHz
*/
#define F_CPU 16000000UL
#define BAUD 19200