Skip to content

Instantly share code, notes, and snippets.

@glebd
glebd / wavecuepoint.c
Created May 2, 2023 23:20 — forked from TimMoore/wavecuepoint.c
This code reads a .wav file and a text file containing marker locations (specified as frame indexes, one per line) and creates a new .wav file with embedded cue points for each location. The code is standard, portable C.
//
// wavecuepoint.c
// Created by Jim McGowan on 29/11/12.
// Turned into command-line utility by David Hilowitz on 19/11/16.
// jim@bleepsandpops.com
// jim@malkinware.com
//
// This function reads a .wav file and a text file containing marker locations (specified as frame indexes, one per line)
// and creates a new .wav file with embedded cue points for each location. The code is standard, portable C.
//
@glebd
glebd / C++ normal operators.md
Created May 11, 2019 00:12 — forked from beached/C++ normal operators.md
A list of the normal signatures of C++ operators that allow overloading

C++ Operator Signatures

This is a list of C++ operators that can be overloaded and their normal signatures(a.k.a what an int would do). The order is the preffered order to use them(The first one listed is often preffered)

Arithmetic

operator+ addition

  • free function -> T operator+( T const & lhs, T const & rhs )
  • member function -> T operator+( T const & rhs ) const

operator+ unary plus

  • member function -> T operator+( ) const
/*
* $TM_FILENAME
* ${1:`echo "$TM_FILEPATH" | awk -F"/" '{x=NF-1}{print $x}'`}
*
* Created by `id -P | awk -F ":" '{ print $8 }'` on `date "+%d/%m/%Y"`.
*
* Copyright (c) 2009 ${2:$TM_ORGANIZATION_NAME}
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
/*
Say you have a largeish C++ class. You want to use it from ObjC. ObjC++ is painful;
C++ is painful. .mm files are bad. How about if we could just treat that C++
object as an ObjC object whenever it exits C++ land?
Apple already solved this problem once with toll free bridging. The tricky part is
vtables -- with a vtable, isa isn't at offset 0 of the memory layout of the object.
The code below is a work in progress to work around this.
*/
/*
Copyright (c) 2009 Remy Demarest
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following