This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#define _CheckTypes(a,b) _Static_assert(_Generic(a, typeof (b):1, default: 0), "Mismatched types") | |
#define Min(a,b) \ | |
({ \ | |
const typeof (a) _a = (a); \ | |
const typeof (b) _b = (b); \ | |
_CheckTypes(_a,_b); \ | |
(_a < _b ? _a : _b); \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Bash script to assert that the current version of the NDK is at least the | |
# specified version. Prints 'true' to standard out if it's the right version, | |
# 'false' if it's not. | |
# | |
# Typically used like this, in your jni/Android.mk: | |
# | |
# ifneq ($(shell $(LOCAL_PATH)/assert_ndk_version.sh "r5c"),true) | |
# $(error NDK version r5c or greater required) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Bash script to assert that the current version of the SDK is at least the | |
# specified version. Prints 'true' to standard out if it's the right version, | |
# 'false' if it's not. | |
# | |
# Typically used like this, in your Makefile: | |
# | |
# ifneq ($(shell $(LOCAL_PATH)/assert_sdk_version.sh "r16"),true) | |
# $(error SDK version r16 or greater required) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
namespace JPT | |
{ | |
public class TextProgressBar : IDisposable | |
{ | |
private int _progress; | |
private int _total; | |
private int _width; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Number of seconds we wait after a file is received before we consider the | |
# batch to be completed. | |
TIMEOUT=2 | |
# Title of the tab in Kaleidoscope | |
LABEL="P4V ksdiff-batch" | |
# FIFO we communicate with the "batch master" for. | |
fifo="/tmp/ksdiff-batch-$USER" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -xe | |
API_KEY="YOUR_API_KEY_GOES_HERE" | |
FPS="10" | |
VLC_PATH="/Applications/VLC.app/Contents/MacOS/VLC" | |
# I don't know how this'll behave on multimon, so you might want to hard-code. | |
# INRES='1440x900' | |
INRES=$(osascript -e 'tell application "Finder" to get bounds of window of desktop'|sed 's/, /x/g'|cut -f3- -dx) | |
OUTRES='1280x800' | |
# You can change this to record microphone or something else, from man soxformat (under coreaudio): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
checking for FRIBIDI... configure: error: Package requirements (fribidi >= 0.19.0) were not met: | |
No package 'fribidi' found | |
Consider adjusting the PKG_CONFIG_PATH environment variable if you | |
installed software in a non-standard prefix. | |
Alternatively, you may set the environment variables FRIBIDI_CFLAGS | |
and FRIBIDI_LIBS to avoid the need to call pkg-config. | |
See the pkg-config man page for more details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DIR=$(cd "$(dirname "$0")"; pwd) | |
MONO=`which mono` | |
if [ ! -z "$MONO" ]; then | |
TXT=`${MONO} -V` | |
VERSION="${TXT#"${TXT%%[[:digit:]]*}"}" | |
VERSION="${VERSION%%[^[:digit:].]*}" | |
VERSION="${VERSION//[!0-9\.]/}" | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
@protocol HTTPSCertificateRetrieverDelegate <NSObject> | |
/** | |
* Called when we succeed (or fail) to retrieve the certificate. | |
* | |
* @param certificate nil if we fail, otherwise the data of the certificate. | |
*/ | |
- (void)certificateRetrieved:(NSData*)certificate; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defaults write com.apple.finder NSUserKeyEquivalents -dict-add "Add to Sidebar" nil |
NewerOlder