Skip to content

Instantly share code, notes, and snippets.

@tctony
tctony / build-libopus-m1.sh
Created August 1, 2022 11:21 — forked from mmsarquis/build-libopus-m1.sh
Build Opus library on Mac M1 for multiple platforms
apple#!/bin/bash
VERSION="1.3.1"
SDKVERSION_IPHONE="14.5"
ARCHS_DEVICES_IPHONE="arm64e armv7"
ARCHS_SIMULATOR_IPHONE="x86_64 arm64"
SDKVERSION_WATCH="7.4"
ARCHS_DEVICES_WATCH="arm64_32 armv7k"
@tctony
tctony / Makefile
Created September 25, 2019 09:06 — forked from mawenbao/Makefile
googletest simple example
# Makefile for gtest examples
GOOGLE_TEST_LIB = gtest
GOOGLE_TEST_INCLUDE = /usr/local/include
G++ = g++
G++_FLAGS = -c -Wall -I $(GOOGLE_TEST_INCLUDE)
LD_FLAGS = -L /usr/local/lib -l $(GOOGLE_TEST_LIB) -l pthread
OBJECTS = main.o string-compare.o
@tctony
tctony / Makefile
Created September 25, 2019 09:06 — forked from mawenbao/Makefile
googletest simple example
# Makefile for gtest examples
GOOGLE_TEST_LIB = gtest
GOOGLE_TEST_INCLUDE = /usr/local/include
G++ = g++
G++_FLAGS = -c -Wall -I $(GOOGLE_TEST_INCLUDE)
LD_FLAGS = -L /usr/local/lib -l $(GOOGLE_TEST_LIB) -l pthread
OBJECTS = main.o string-compare.o
@tctony
tctony / pre-commit-clang-format
Created April 8, 2019 10:26 — forked from wangkuiyi/pre-commit-clang-format
Git pre-commit hook that invokes clang-format to reformat C/C++/Objective-C source code.
#!/bin/bash
# git pre-commit hook that runs an clang-format stylecheck.
# Features:
# - abort commit when commit does not comply with the style guidelines
# - create a patch of the proposed style changes
# modifications for clang-format by rene.milk@wwu.de
# This file is part of a set of unofficial pre-commit hooks available
# at github.
@tctony
tctony / emacs-pidfile.el
Created July 25, 2017 15:21 — forked from avdi/emacs-pidfile.el
Write pidfile on emacs-server startup
(setq pidfile "emacs-server.pid")
(add-hook 'emacs-startup-hook
(lambda ()
(with-temp-file pidfile
(insert (number-to-string (emacs-pid))))))
(add-hook 'kill-emacs-hook
(lambda ()
(when (file-exists-p pidfile)
(delete-file pidfile))))
@tctony
tctony / redis.service
Last active July 25, 2017 07:10 — forked from ordoghl/redis.service
redis systemd unit file
[Unit]
Description=Redis In-Memory Data Store
After=network.target
[Service]
User=redis
Group=redis
LimitCORE=infinity
LimitNOFILE=100000
LimitNPROC=100000
@tctony
tctony / post-merge
Created August 4, 2016 16:23 — forked from sindresorhus/post-merge
git hook to run a command after `git pull` if a specified file was changed.In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed.Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
#!/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
@tctony
tctony / dotvimrc
Created July 19, 2016 06:25
centos-dotvimrc
" begin $HOME/vimrc
" Last Updated: 2014-12-26
set nocompatible " use vim settings rather than vi settings
set backspace=2 " backspace over line breaks
set history=1000 " store lots of :cmdline history
set showcmd " show incomplete commands at the bottom
set showmode " what mode am I in
set autoread " reload files changed outside of vim
set laststatus=1 " show status line if more than one window