Skip to content

Instantly share code, notes, and snippets.

View matthewjberger's full-sized avatar
🦀
Writing something in Rust, probably

Matthew J. Berger matthewjberger

🦀
Writing something in Rust, probably
  • Hyphen
View GitHub Profile
`emacs --daemon` to run in the background.
`emacsclient.emacs24 <filename/dirname>` to open in terminal
NOTE: "M-m and SPC can be used interchangeably".
* Undo - `C-/`
* Redo - `C-?`
* Change case: 1. Camel Case : `M-c`
2. Upper Case : `M-u`
3. Lower Case : `M-l`
Font=Powerline Consolas
ForegroundColour=131,148,150
BackgroundColour=0,43,54
CursorColour=220,50,47
Black=7,54,66
BoldBlack=0,43,54
Red=220,50,47
BoldRed=203,75,22
Green=133,153,0
BoldGreen=88,110,117
@matthewjberger
matthewjberger / .gitconfig
Last active December 19, 2016 16:48
Windows Dot Files
[user]
name = Matthew J. Berger
email = [email protected]
[core]
editor = vim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
excludesfile = ~/.gitignore
[sendemail]
smtpencryption = tls
smtpserver = smtp.gmail.com
@matthewjberger
matthewjberger / Explanation.ps1
Last active January 5, 2017 19:50
secret message
# Load security dll
[Reflection.Assembly]::LoadWithPartialName("System.Security");
# Clear the screen
cls;
# Salt. Added to make a common password uncommon, even though ours is a jumbled mess of letters on purpose.
$salt="SaltCrypto";
# Password to use
python
print "---- Loading Rust pretty-printers ----"
sys.path.insert(0, "C:/Users/Matth/Home/rust/src/etc")
import gdb_rust_pretty_printing
gdb_rust_pretty_printing.register_printers(gdb)
end
@matthewjberger
matthewjberger / c#-to-rust.md
Created December 9, 2016 17:48 — forked from carols10cents/c#-to-rust.md
C# to Rust Cheat Sheet

Thanks to @seejee for making this for me!!!

C# to Rust Cheat Sheet

The goal of this is to have an easily-scannable reference for the most common syntax idioms in C# and Rust so that programmers most comfortable with C# can quickly get through the syntax differences and feel like they could read and write basic Rust programs.

What do you think? Does this meet its goal? If not, why not?

Variables

@matthewjberger
matthewjberger / Algorithms Notes.md
Last active December 15, 2016 23:01
Algorithms Knowledge collection

Running Time:

  • The number of (primitive) operations an algorithm performs before coming to a halt. The running time is expressed as a function of the input size n.
  • Three Methods (of many) of solving recurrence relations:
    • Master method
      • T(n) = aT(n/b) + n^d where a >= 1, b > 1
        • n is the size of the problem.
        • a is the number of subproblems in the recursion.
  • n/b is the size of each subproblem
@matthewjberger
matthewjberger / calc_bf.py
Last active February 2, 2017 18:43
An algorithm to approximate bodyfat percentage - https://repl.it/EtYI/2
def calcBf(weightLbs, waistGirthAroundBellyButton):
m = 1.082 * weightLbs
n = 4.15 * waistGirthAroundBellyButton
bfLbs = 94.42 + m - n
bfDiffLbs = abs(weightLbs - bfLbs)
bfPercent = 100 * (bfDiffLbs/weightLbs)
print("You are " + "{0:.2f}".format(bfPercent) +"% bodyfat")
calcBf(156, 33)
@matthewjberger
matthewjberger / Notes.md
Created December 19, 2016 20:16
Computer Organization and architecture notes

Chapter 17 - Parallel Processing

General Organization

  • Four types of organization
  • SISD
    • Single Instruction, Single Data stream
    • Single processor executes a single instruction stream to operate on data stored in a single memory.
    • Examples: Uniprocessors
  • SIMD
  • Single Instruction, Multiple Data stream
@matthewjberger
matthewjberger / loading.org
Created December 28, 2016 15:40 — forked from TheBB/loading.org
Loading in Spacemacs

Emacs packages, features, files, layers, extensions, auto-loading, require, provide, use-package… All these terms getting you confused? Let’s clear up a few things.

Files

Emacs files contains code that can be evaluated. When evaluated, the functions, macros and modes defined in that file become available to the current Emacs session. Henceforth, this will be termed as loading a file.

One major problem is to ensure that all the correct files are loaded, and in the