Skip to content

Instantly share code, notes, and snippets.

View lukewendling's full-sized avatar

Luke Wendling lukewendling

View GitHub Profile
from multiprocessing import Process
import os
import time
PRIMES_MAX = 10000000
def primes(n):
# info('primes')
if n==2:
return [2]
to start a session
> screen
(now run some commands)
within screen, to detach (and keep session running)
> ctl a + d
outside of screen, list screen sessions
> screen -ls
@lukewendling
lukewendling / numba-numpy.py
Created March 3, 2018 16:25
Numba + Numpy benchmark
from numba import jit
from numpy import arange
import numpy as np
def sum2d_loop(arr):
M, N = arr.shape
result = 0.0
for i in range(M):
for j in range(N):
result += arr[i,j]
<!--//
RubyRobot
Copyright (c) 2008 Fabio Zendhi Nagao <http://zend.lojcomm.com.br/>
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
@lukewendling
lukewendling / help.md
Last active June 7, 2018 14:01
h4us Help

Create reminders without typing

30 sec. how-to video https://youtu.be/Yk-ypBpMnDg

Example "Just Ask"

Just ask Luke in 1 hour. Bring a Raspberry Pi.

Just ask Mom tomorrow at 3pm. Reminder for doctor appt.

@lukewendling
lukewendling / panderwacker
Created September 7, 2018 01:34
delores panderwacker
a
@lukewendling
lukewendling / short-color-prompt.sh
Created July 4, 2020 11:45
short colorful bash prompt
# Prompt format: username:os:currentdir>
# luke:debian10:myapps>
CURR_DIR=$(basename "$PWD")
ID=$(grep -oP '(?<=^ID=).+' /etc/os-release | tr -d '"')
VERSION=$(grep -oP '(?<=^VERSION_ID=).+' /etc/os-release | tr -d '"')
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u\[\033[00m\]:$ID$VERSION:\[\033[01;34m\]${CURR_DIR}\[\033[00m\]> '