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
tell application "NicePlayer" | |
set movie_file to path of current movie in front playlist as alias | |
tell application "Finder" | |
set label index of movie_file to 6 | |
-- display alert (name of first file in container of movie_file as Unicode text) | |
set filelist to files in container of movie_file | |
set all_watched to yes | |
repeat with the_file in filelist | |
if name extension of the_file is in {"avi", "mpg", "mp4", "wmv"} and label index of the_file is not equal to 6 then | |
set all_watched to no |
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
# Alignes the source | |
def align(text, regexp, width) | |
text.to_a.map do |line| | |
if offset = offsetOfRegexpInLine(line, regexp) | |
if shouldInsertBefore(line, regexp) | |
before = line[0..offset-1] | |
before + ' ' * (width - (before.length)) + line[offset..line.length-1] | |
else | |
before = line[0..offset] | |
before + ' ' * (width - (before.length-1)) + line[offset+1..line.length-1] |
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
#include <Onigmo/oniguruma.h> | |
#define ONIG_OPTION_BACKWARD (ONIG_OPTION_MAXBIT << 1) | |
OnigRegex pattern (char const* ptrn, OnigOptionType options = ONIG_OPTION_NONE) | |
{ | |
OnigErrorInfo einfo; | |
OnigRegex regex = nullptr; | |
OAK_ASSERT_EQ(ONIG_NORMAL, onig_new(®ex, (OnigUChar const*)ptrn, (OnigUChar const*)ptrn + strlen(ptrn), options, ONIG_ENCODING_UTF8, ONIG_SYNTAX_DEFAULT, &einfo)); | |
return regex; |
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
#!/usr/bin/env bash | |
progname=$(basename $0) | |
version="1.0 (2014-08-17)" | |
step=2 | |
function create_hash { | |
openssl dgst -sha1 -binary <<< "$1" | xxd -p | |
} |
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 <clang-c/Index.h> | |
#import <Foundation/Foundation.h> | |
#import <regex> | |
#import <stdio.h> | |
#import <map> | |
#import <string> | |
#import <set> | |
template <typename _InputIter> | |
std::string strings_to_regexp (_InputIter first, _InputIter last) |
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
#if (__cplusplus && __cplusplus >= 201103L && (__has_extension(cxx_strong_enums) || __has_feature(objc_fixed_enum))) || (!__cplusplus && __has_feature(objc_fixed_enum)) | |
#warning "we are OK" | |
#endif | |
#import <CoreFoundation/CoreFoundation.h> | |
#import <MacTypes.h> | |
#import <stdio.h> | |
#import <stdint.h> | |
#import <math.h> | |
#import <pthread.h> |
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
#!/usr/bin/env ruby -wU | |
require 'erb' | |
require 'fileutils' | |
require 'shellwords' | |
# extension to String to extract colours into rgb array | |
class String | |
# hex to array | |
def h2a |
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
std::string fontStyle; | |
if(plist::get_key_path(plist, "settings.fontStyle", fontStyle)) | |
{ | |
bool hasPlain = fontStyle.find("plain") != std::string::npos; | |
bool hasBold = fontStyle.find("bold") != std::string::npos; | |
bool hasItalic = fontStyle.find("italic") != std::string::npos; | |
bool hasUnderline = fontStyle.find("underline") != std::string::npos; | |
res.bold = hasBold ? bool_true : (hasPlain ? bool_false : bool_unset); | |
res.italic = hasItalic ? bool_true : (hasPlain ? bool_false : bool_unset); |
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
#!/usr/bin/env ruby -wU | |
require 'erb' | |
require 'fileutils' | |
require 'shellwords' | |
# extension to String to extract colours into rgb array | |
class String | |
# hex to array | |
def h2a | |
if self.length == 4 |
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 <CoreServices/CoreServices.h> | |
int main (int argc, char const* argv[]) | |
{ | |
CFShow(LSCopyApplicationURLsForBundleIdentifier(CFSTR("com.macromates.TextMate"), nullptr)); | |
return 0; | |
} |
OlderNewer