Skip to content

Instantly share code, notes, and snippets.

View jconst's full-sized avatar

Joseph Constantakis jconst

View GitHub Profile
@jconst
jconst / tictactoe.py
Created March 12, 2015 23:04
tictactoe.py
X = 'X'
O = 'O'
theBoard = [[None for _ in range(3)] for _ in range(3)]
def owner(line):
return reduce(lambda acc,cur: acc if acc == cur else None, line, line[0])
def diags(board):
return [[x[i] for i, x in enumerate(board)],
[x[i] for i, x in enumerate(reversed(board))]]
//
// Audiobus.swift
// AudioKit
//
// Created by Daniel Clelland on 2/06/16.
// Updated for AudioKit 3 by Aurelius Prochazka.
//
// Copyright © 2016 AudioKit. All rights reserved.
//
import Foundation
public struct Matrix<Scalar: CustomStringConvertible> {
public let width: Int
public let height: Int
public var grid: [Scalar]
}
// MARK: - Creating matrices
@jconst
jconst / aliases.sh
Created June 10, 2021 00:18
Jconst's aliases
# usage: Add this file to your home dir, then add `source ~/aliases.sh` to your .bashrc file
# git aliases:
alias g="git"
alias gs="git status"
alias gc="git commit"
alias gcm="git commit -m"
alias gl="git log --oneline --graph --decorate --all --abbrev-commit"
alias gp="git push"
@jconst
jconst / merge-wrapper
Created June 10, 2021 05:19
merge-wrapper for UnityYAMLMerge
#!/bin/bash
# Wrapper script for git mergetool
# This requires the .gitconfig file to have:
# - mergetool entry for "unityyamlmerge";
# - mergetool entry for "p4mergetool";
# These merge tool entries must both specify the
# cmd field. The command to call this script:
# [mergetool "merge_wrapper"]
# cmd = $HOME/merge-wrapper \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\"
# Locate this script in your $HOME
@jconst
jconst / jhPitchShift.cpp
Created February 26, 2018 19:36
Implementation of "Ocean" pitch-shifting method via a modified version of smbPitchShift.cpp
// Modified version of SMB's pitch shift to use the algorithm described in
// Nicolas Juillerat & Beat Hirsbrunner's 2010 paper "LOW LATENCY AUDIO PITCH
// SHIFTING IN THE FREQUENCY DOMAIN".
#include <string.h>
#include <math.h>
#include <stdio.h>
#include <Accelerate/Accelerate.h>