Skip to content

Instantly share code, notes, and snippets.

View CandyGumdrop's full-sized avatar

Candy Gumdrop CandyGumdrop

View GitHub Profile
@CandyGumdrop
CandyGumdrop / sound_of_the_c.c
Created April 29, 2018 23:02
Sound of the C
#include <stdio.h>
#include <stdint.h>
#include <math.h>
#define RATE 44100.0
#define PI 3.1415926535897932384626
#define F_DOMAIN_SIZE 64
#define SONG_LENGTH 96
#define CHORD_LENGTH 4
@CandyGumdrop
CandyGumdrop / doctrine-checkout.sh
Last active January 16, 2023 10:08
Automatically runs Symfony2 Doctrine migrations to checkout a branch cleanly.
#!/bin/bash
# Commit ref of current HEAD
start_commit="$(git rev-parse HEAD)"
# Commit ref of what is to be checked out
dest_commit="$1"
# First common ancestor commit between the two branches
ancestor="$(git merge-base HEAD "$dest_commit")"