Skip to content

Instantly share code, notes, and snippets.

View seanjensengrey's full-sized avatar

Sean Jensen-Grey seanjensengrey

View GitHub Profile
@seanjensengrey
seanjensengrey / osx_cpulimits.sh
Created February 16, 2020 05:56
throttling mdworker on osx
#! /bin/bash
# from https://www.facebook.com/notes/netways/wenn-das-macbook-zu-hei%C3%9F-ist-cpulimitsh/10150313173463753/
# Description:
#
# If you want to decrease the CPU demands for an application
# you can use this very simple and ugly "hack".
# I use it when I convert videos on my MacBook Pro
# to prevent it from getting to warm. Even if the CPU is IDLE this hack
# will prevent the application to use the CPU during Sleep Time
# (in contrast to renice/nice commands which will take all IDLE time).
In [17]: (a, (b)) = (1, (2,3, ([4,5,6])))                                                                                                                     

In [18]: b                                                                                                                                                    
Out[18]: (2, 3, [4, 5, 6])

In [19]: (a, (b,e,(f))) = (1, (2,3, ([4,5,6])))                                                                                                               

In [20]: a                                                                                                                                                    
Out[20]: 1

$java -XX:+PrintFlagsFinal -version

[Global flags]
ccstrlist AOTLibrary                               =                                          {product} {default}
      int ActiveProcessorCount                     = -1                                       {product} {default}
    uintx AdaptiveSizeDecrementScaleFactor         = 4                                        {product} {default}
    uintx AdaptiveSizeMajorGCDecayTimeScale        = 10                                       {product} {default}
    uintx AdaptiveSizePolicyCollectionCostMargin   = 50                                       {product} {default}
    uintx AdaptiveSizePolicyInitializingSteps      = 20                                       {product} {default}
Logo Memo 1 AIM-246.pdf A Computer Laboratory For Elementary Schools
Logo Memo 2 AIM-247.pdf Teaching Children Thinking
Logo Memo 3 AIM-248.pdf Twenty Things To Do With A Computer
Logo Memo 4 AIM-249.pdf Teaching Children To Be Mathematicians vs. Teaching About Mathematics
Logo Memo 5 AIM-254.pdf NIM: A Game-Playing Program
Logo Memo 6 AIM-264.pdf Developing A Musical Ear: A Ne
@seanjensengrey
seanjensengrey / settings.json
Created May 5, 2018 17:16
vscode settings override
{
"workbench.colorCustomizations": {
"contrastActiveBorder": "#c210bc",
"input.border": "#FE2EF7",
"selection.background": "#58FAF4",
"editor.selectionBackground": "#58FAF4",
"widget.shadow": "#76e67b",
"editor.lineHighlightBorder": "#ff0000"
},
"editor.wrappingIndent": "indent",
==> Caveats
OPAM uses ~/.opam by default for its package database, so you need to
initialize it first by running (as a normal user):
$ opam init
Run the following to initialize your environment variables:
$ eval `opam config env`
@seanjensengrey
seanjensengrey / redrotate.rs
Created April 9, 2018 05:01
kiss3d rotating cubes
extern crate kiss3d;
extern crate nalgebra as na;
use na::{Vector3, UnitQuaternion};
use kiss3d::window::Window;
use kiss3d::light::Light;
fn main() {
let mut window = Window::new("Kiss3d: cube");
let mut c = window.add_cube(1.0, 1.0, 1.0);
@seanjensengrey
seanjensengrey / build.sh
Created April 4, 2018 18:17
wrk2 in a docker container
#!/bin/bash
set -x
mkdir build-temp
pushd build-temp
git clone https://github.com/giltene/wrk2
docker run --rm -v $PWD/wrk2:/wrk2 sjg/builder:v1 /bin/bash -c 'cd wrk2; make'
popd
docker build -t sjg/wrk2:v2 .
@seanjensengrey
seanjensengrey / octal_x86.txt
Created April 1, 2018 16:28
x86 is an octal machine
# source:http://reocities.com/SiliconValley/heights/7052/opcode.txt
From: mark@omnifest.uwm.edu (Mark Hopkins)
Newsgroups: alt.lang.asm
Subject: A Summary of the 80486 Opcodes and Instructions
(1) The 80x86 is an Octal Machine
This is a follow-up and revision of an article posted in alt.lang.asm on
7-5-92 concerning the 80x86 instruction encoding.
The only proper way to understand 80x86 coding is to realize that ALL 80x86