This file contains hidden or 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
| typedef enum { | |
| ET_Unknown, | |
| ET_Little, | |
| ET_Big | |
| } endian_type_e; | |
| endian_type_e byte_order() | |
| { | |
| union { | |
| short num_as_short; |
This file contains hidden or 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
| set -e | |
| set -u | |
| # https://stackoverflow.com/questions/1028649/how-do-you-rename-a-git-tag | |
| # old_name new_name | |
| rename_git_tag() | |
| { | |
| local readonly old=$1 | |
| local readonly new=$2 |
This file contains hidden or 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
| [ | |
| { | |
| "key": "ctrl+cmd+left", | |
| "command": "workbench.action.navigateBack" | |
| }, | |
| { | |
| "key": "ctrl+cmd+right", | |
| "command": "workbench.action.navigateForward" | |
| }, | |
| { |
This file contains hidden or 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
| func setVersionLabel() | |
| { | |
| let mainBundle = Bundle.main | |
| let version = mainBundle.infoDictionary!["CFBundleShortVersionString"] as! String | |
| let build = mainBundle.infoDictionary![kCFBundleVersionKey as String] as! String | |
| versionLabel.text = "Version \(version) Build: \(build)" | |
| } |
This file contains hidden or 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
| [ | |
| { "key": "alt+cmd+left", "command": "editor.fold", | |
| "when": "editorTextFocus" }, | |
| { "key": "alt+cmd+right", "command": "editor.unfold", | |
| "when": "editorTextFocus" }, | |
| { "key": "cmd+alt+[", "command": "editor.action.moveLinesUpAction", | |
| "when": "editorTextFocus" }, | |
| { "key": "cmd+alt+]", "command": "editor.action.moveLinesDownAction", | |
| "when": "editorTextFocus" }, |
This file contains hidden or 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
| // https://stackoverflow.com/questions/3073520/animate-text-change-in-uilabel | |
| // | |
| - (void)animate:(UILabel*)label with:(NSString*)text | |
| { | |
| CATransition* animation = [CATransition animation]; | |
| animation.timingFunction = | |
| [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; | |
| animation.type = kCATransitionFade; | |
| animation.duration = 0.75; | |
| [label.layer addAnimation:animation forKey:@"kCATransitionFade"]; |
This file contains hidden or 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 | |
| # shell script to execute OpenCV tests prior to creating pull request | |
| set -o errexit | |
| set -o nounset | |
| main() | |
| { | |
| cd $CURRENT_PATH/build/bin/Debug | |
| ./opencv_annotation | |
| ./opencv_createsamples |
This file contains hidden or 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
| @implementation VersionStringDemo | |
| - (void)updateVersionLabel | |
| { | |
| NSString* version = | |
| [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]; | |
| NSString* build = | |
| [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString*)kCFBundleVersionKey]; | |
| NSString* versionString = [NSString stringWithFormat:@"Version: %@ Build: %@", version, build]; |
This file contains hidden or 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 | |
| set -o errexit | |
| set -o pipefail | |
| set -o nounset | |
| setup_opencv() | |
| { | |
| printf "*********************************\n${FUNCNAME[0]}\n" | |
| local readonly PARENT_FOLDER=${1:-third_party} |
This file contains hidden or 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
| tell application "Mail" | |
| set mySelection to selection | |
| set myMessage to item 1 of mySelection | |
| set theSender to sender of myMessage | |
| extract address from theSender | |
| -- https://stackoverflow.com/questions/15670363/applescript-to-find-domain-of-the-sender-of-mail-and-add-it-to-the-rules | |
| set theDomain to (do shell script "echo " & quoted form of rich text 1 through -2 of theSender & " | awk " & quoted form of "{split($0,a,\"@\"); print a[2]}") | |
| display dialog theDomain |