Skip to content

Instantly share code, notes, and snippets.

Working from home


Working from home
View GitHub Profile
lucasea777 / index.html
Created Jul 27, 2019
Parallax.js in React
View index.html
<div id="svg_mount_example"></div>
lucasea777 / Dockerfile
Created May 4, 2019 — forked from dsuess/Dockerfile
xeus-cling C++ Jupyter kernel inside a docker container
View Dockerfile
FROM frolvlad/alpine-miniconda3
RUN conda install -y -c conda-forge bash jupyter jupyter_contrib_nbextensions
RUN conda install -y -c conda-forge xeus-cling xtensor
RUN mkdir /notebooks
lucasea777 /
Created Jun 8, 2018
Pretty print matrix with colors proportional to each value.
import numpy as np
A = np.random.randint(-100, 100, size=(7, 7))
def pformat(A, header=True):
mv = min([min([int(v) for v in row]) for row in A])
Mv = max([max([int(v) for v in row]) for row in A])
f = lambda r, m, M: int(- (255*r)/(m - M) + (255*m)/(m-M))
#c = '\033[38;2;{1};{2};{3};48;2;0;0;0m{0}\033[0m'.format
c = '\033[38;2;{1};{2};{3}m{0}\033[0m'.format
middle = (Mv - mv)/2 + mv
lucasea777 /
Created May 19, 2018 — forked from Artanis/
Python C Extension Hello World
gcc -fpic --shared $(python3-config --includes) greetmodule.c -o
# can also use $(pkg-config --cflags python-3.5)
# or
# python3 install --record files.txt --user
View auto-remove-sublime-license-popup
# -*- coding: utf-8 -*-
import sublime_plugin
import subprocess
from time import sleep
import sys
cl = lambda line: subprocess.Popen(line, shell=True, stdout=subprocess.PIPE).communicate()[0].strip()
log = lambda message: sys.stderr.write("Log: %s\n" % message)
lucasea777 / httpget.js
Created Oct 7, 2016 — forked from duncansmart/httpget.js
Download a file with Windows Script Host
View httpget.js
// httpget.js: download a file (Windows Script Host)
// usage: cscript httpget.js <url> <file>
(function() {
if (WScript.Arguments.Length != 2) {
WScript.Echo("Usage: httpget.js <url> <file>")
var url = WScript.Arguments(0)
#!/usr/bin/env python
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.