Skip to content

Instantly share code, notes, and snippets.

:octocat:
Supportocat-ing

Matt B Mattamorphic

:octocat:
Supportocat-ing
Block or report user

Report or block Mattamorphic

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Mattamorphic
Mattamorphic / README.md
Created Feb 14, 2020
Useful git commands
View README.md

Sign commits on the current branch since the SHA (inclusive)

git rebase --exec 'git commit --amend --no-edit -n -S' -i SHA^
View hello-world.cpp
#include <mpi.h>
#include <stdio.h>
int main(int argc, char** argv) {
// Initialize the MPI environment
MPI_Init(NULL, NULL);
// Get the number of processes
int world_size;
MPI_Comm_size(MPI_COMM_WORLD, &world_size);
@Mattamorphic
Mattamorphic / Makefile
Last active Feb 13, 2020
Reusable makefile to use with Vagrant Open-MPI cluster
View Makefile
##
# Reusable Makefile
#
# usage: `make [PROCESS] TARGET=[FILENAME_NO_EXT] NODES=node1,node2,node3`
# example: `make all TARGET=hello-world NODES=node1,node2,node3`
COMPILER=mpic++
COMPILER_FLAGS=-g -std=c++0x -O0
OBJECTS=$(TARGET).o
HOSTS=--host $(NODES)
PROCESS_COUNT = -np $(shell echo $(NODES), | grep -o "," | wc -l)
@Mattamorphic
Mattamorphic / Vagrantfile
Created Feb 4, 2020
Open-mpi Vagrant 3-Node cluster
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
# choose how many machines the cluster will contain
N_VMS = 3
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
@Mattamorphic
Mattamorphic / InsertionSortAction.java
Created Nov 1, 2019
Parallel MergeSort using Java
View InsertionSortAction.java
package com.mattamorphic.concurrent.assignment2;
import java.util.concurrent.RecursiveAction;
import java.util.ArrayList;
public class InsertionSortAction extends RecursiveAction {
private ArrayList<Integer> list;
InsertionSortAction(ArrayList<Integer> list) {
this.list = list;
@Mattamorphic
Mattamorphic / docker-example.yml
Created Oct 14, 2019
Docker with GitHub Actions
View docker-example.yml
name: Publish Docker image
on:
push:
branches:
- master
paths:
- 'docker-example/*'
- '.github/workflows/docker-example.yml'
@Mattamorphic
Mattamorphic / (installing a package) pom.xml
Last active Dec 5, 2019
Example Maven Configuration : Installing a package
View (installing a package) pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mattamorphic.maven.gpr</groupId>
<artifactId>maven-install-test</artifactId>
<version>1.0.0</version>
@Mattamorphic
Mattamorphic / implementation.py
Last active Oct 1, 2019
Gradient Descent Example Python
View implementation.py
# Given f(x) = x**4 - 3**3 + 2 = f1(x) = 4x**3 - 9**2
# lets start at x = 6
curr_x = 6
gamma = 0.001
precision = 0.0000001
step_size = 1
max_iterations = 1000
i = 0
df = lambda x: (4 * x**3) - (9**2)
@Mattamorphic
Mattamorphic / account.ts
Created Sep 24, 2019
Example Typescript Webhooks
View account.ts
export enum AccountType {
USER = 'User',
ORGANIZATION = 'Organization'
}
export interface Account {
login: string;
id: number;
node_id: string;
avatar_url: string;
@Mattamorphic
Mattamorphic / publish.yml
Last active Feb 25, 2020
NPM Publish GitHub Package Registry
View publish.yml
name: Deploy package to GitHub package registry
on:
pull_request:
branches:
- master
push:
branches:
- master
jobs:
build:
You can’t perform that action at this time.