Skip to content

Instantly share code, notes, and snippets.

@aghasemi
aghasemi / streamlit-app.py
Created February 9, 2022 21:15
A way to send a Toast message in streamlit and using the Toastify.js library
import streamlit.components.v1 as components
_ = components.html(
"""
<script>
function loadScript(url)
{
return new Promise(function(resolve, reject) {
/*#sideNavBox .ms-core-listMenu-item, #sideNavBox .ms-core-listMenu-item:link, #sideNavBox .ms-core-listMenu-item:visited, #sideNavBox .ms-tv-item:link, #sideNavBox .ms-tv-item:visited, #sideNavBox .ms-tv-header:link, #sideNavBox .ms-tv-header:visited {
color: hsl(219, 100%, 27%);
width: 50%;
}*/
#contentBox{
width: 75%;
margin-left: 320px;
}
@aghasemi
aghasemi / brewstrap-cb.sh
Last active October 26, 2016 08:45
Brewstrap installer script for ChromiumOS devices
#Believe it or not, you _can_ install Homebrew/Linuxbrew on your shiny new Chromebook without [dual-booting](http://chromeos-cr48.blogspot.fr/) or [chrooting](https://github.com/dnschneid/crouton) another operating system like Ubuntu; nay, you can enjoy the goodness of CLI programs like `vim`, `zsh`, `ruby` , and all the other goodies Linuxbrew has to offer (not to mention anything you can compile from source) while still being able to flaunt your fancy Chrome OS GUI. So let's get started.
#**NOTE STILL IN PROGRESS EVERYTHING SHOULD WORK UNTIL GCC**
#> **Disclaimer**
#> This guide is still in progress and has only been tested on an Acer C720P, so results may vary with other Chromebooks, especially those with other architectures (sorry ARM).
#Prerequisites
#====================
#If you just opened up your factory-fresh Chromebook, the first thing you have to do is [enable developer mode](http://www.cnet.com/how-to/how-to-enable-developer-mode-on-a-chromebook/). If that guide doesn't help do a google search
@aghasemi
aghasemi / speedtestserver.js
Created August 30, 2016 10:45
The NodeJS equivalent of the PHP code for an internet speed test as explained in the network.js package
var http = require('http');
var express = require('express');
var router = express();
var server = http.createServer(router);
router.get('/speedtestserver', function(req, res){