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
//////////////////////////////////////////////////////////////////////////////// | |
// Class to substitute for cout to get synchronization of output. | |
// Usage: syncout << "foo " << 0xff << syncendl; | |
using namespace std; | |
class syncostringstream : public ostringstream {}; | |
#define syncout syncostringstream() | |
ostream &syncendl(ostream &ostr) | |
{ | |
if(auto *sostr = dynamic_cast< syncostringstream* >( &ostr )) | |
{ |
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
// ==UserScript== | |
// @name Feedly Colorful Listview | |
// @namespace http://feedly.colorful.list.view | |
// @description Colorizes items headers based on their source | |
// @include http*://feedly.com/* | |
// @include http*://*.feedly.com/* | |
// @version 0.8.9 | |
// @grant GM_addStyle | |
// ==/UserScript== |
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
// ==UserScript== | |
// @name Feedly Open Tags Dropdown | |
// @namespace http://prw.prehiti.net/ | |
// @version 0.9.14 | |
// @description Show the Feedly tag entry dropdown with a keyboard shortcut. This functionality should be builtin! | |
// @author Payton R White | |
// @include http://feedly.com/* | |
// @include https://feedly.com/* | |
// @include http://*.feedly.com/* | |
// @include https://*.feedly.com/* |
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
#ifdef DEBUG | |
#define NSLogDebug(format, ...) \ | |
NSLog(@"<%s:%d> %s, " format, \ | |
strrchr("/" __FILE__, '/') + 1, __LINE__, __PRETTY_FUNCTION__, ## __VA_ARGS__) | |
#else | |
#define NSLogDebug(format, ...) | |
#endif |
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
# Add the following 'help' target to your Makefile | |
# And add help text after each target name starting with '\#\#' | |
help: ## Show this help. | |
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//' | |
# Everything below is an example | |
target00: ## This message will show up when typing 'make help' | |
@echo does nothing |
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 | |
echo PWD = ${PWD} | |
echo SRCROOT = ${SRCROOT} | |
echo BUILT_PRODUCTS_DIR = ${BUILT_PRODUCTS_DIR} | |
# just to be sure | |
cd ${SRCROOT} | |
# using . as source below might not be what you want... feel free to change, etc. |
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 node --harmony | |
"use strict"; | |
var req = require ( "request" ); | |
var fs = require ( "fs" ); | |
# replace these... could be command line args but that would have taken like 15 seconds more. | |
var userid = "06674516782868565233"; | |
var label = "starred"; |
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
@implementation NSJSONSerialization (jsonXpath) | |
+ (NSObject *)objectForPath:(NSString *)jsonXPath container: (NSObject*) currentNode | |
{ | |
if (currentNode == nil) { | |
return nil; | |
} | |
// we cannot go any further | |
if(![currentNode isKindOfClass:[NSDictionary class]] && ![currentNode isKindOfClass:[NSArray class]]) { |
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
# first grep finds lines with potential commands | |
# second grep throws away pure comment lines | |
# then sed throws away anything after initial target name (which should just be the : now) | |
# final uniq throws away dups | |
# could be more optimal :) | |
# could probably do something to generate completes from -f makefile name | |
alias makeCommands 'echo `egrep --only-matching "^.*?: " Makefile | egrep -v "^[[:space:]]*#" | sed "s/\(:.*\)//" | uniq`' | |
complete make 'n/*/`makeCommands`/' |