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 "package depdenencies for $1:" | |
ldd $1 | perl -pe 's|.*?(/.*?)\s*\(.*|\1|' | grep -v linux-gate | xargs -n 1 dpkg --search | perl -pe 's|(.*?):.*|\1|' | sort | uniq |
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
Desktop 🐶 while true; do ruby -e '$a = File.read("nouns.txt").split("\n"); puts "You only get one #{$a[rand($a.length)]}"'; done | |
You only get one swallow | |
You only get one sheep | |
You only get one goat | |
You only get one start | |
You only get one truck | |
You only get one willow | |
You only get one dragonfly | |
You only get one baby | |
You only get one soccer |
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
Desktop 🐶 cat > test.c | |
#include <stdio.h> | |
void bar() { printf("hi\n"); } | |
void foo() { bar(); } | |
int main() { foo(); } | |
Desktop 🐶 cc test.c -Wl,-map -Wl,test.map.txt | |
Desktop 🐶 cat test.map.txt | |
# Path: a.out | |
# Arch: x86_64 | |
# Object files: |
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
test.m:25:4: error: weak receiver may be unpredictably set to nil | |
[-Werror,-Wreceiver-is-weak] | |
[a doStuff]; | |
^ | |
test.m:25:4: note: assign the value to a strong variable to keep the object | |
alive during use |
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
Desktop 🐶 cat test.c | |
static int foo(int b) | |
{ | |
int a; | |
if (b) | |
{ | |
a = 3; | |
} | |
return a; | |
} |
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> | |
void eachrow(size_t total, size_t nrows, size_t ncols, char const*** rows, BOOL(^cb)(size_t i, size_t ncols, char const **row, size_t *lengths)) | |
{ | |
size_t lengths[ncols]; | |
for (size_t k = 0; k < total; ++k) | |
{ | |
size_t i = k % nrows; | |
for (size_t j = 0; j < ncols; ++j) | |
{ |
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
ATFLogError("Couldn't determine rounding mode. Possibiliites:\n"); | |
if (possibilities & (1 << IEEE754RoundTiesToEven)) ATFLogError(" RoundTiesToEven"); | |
if (possibilities & (1 << IEEE754RoundTiesToAway)) ATFLogError(" RoundTiesToAway"); | |
if (possibilities & (1 << IEEE754RoundTowardPositive)) ATFLogError(" RoundTowardPositive"); | |
if (possibilities & (1 << IEEE754RoundTowardNegative)) ATFLogError(" RoundTowardNegative"); | |
if (possibilities & (1 << IEEE754RoundTowardZero)) ATFLogError(" RoundTowardZero"); | |
fail_exit(); |
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
mx::maybe<std::__1::insert_iterator<std::__1::unordered_map<char, std::__1::unordered_map<char, int, std::__1::hash<char>, std::__1::equal_to<char>, std::__1::allocator<std::__1::pair<char const, int> > >, std::__1::hash<char>, std::__1::equal_to<char>, std::__1::allocator<std::__1::pair<char const, std::__1::unordered_map<char, int, std::__1::hash<char>, std::__1::equal_to<char>, std::__1::allocator<std::__1::pair<char const, int> > > > > > > > mx::_mapM<std::__1::pair<char const, std::__1::unordered_map<char, int, std::__1::hash<char>, std::__1::equal_to<char>, std::__1::allocator<std::__1::pair<char const, int> > > >, std::__1::insert_iterator<std::__1::unordered_map<char, std::__1::unordered_map<char, int, std::__1::hash<char>, std::__1::equal_to<char>, std::__1::allocator<std::__1::pair<char const, int> > >, std::__1::hash<char>, std::__1::equal_to<char>, std::__1::allocator<std::__1::pair<char const, std::__1::unordered_map<char, int, std::__1::hash<char>, std::__1::equal_to<char>, std::__1::allocator<s |
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
namespace mx | |
{ | |
namespace | |
{ | |
inline maybe<int32_t> intval(json::object *o, char const *key) | |
{ | |
return (*o)[key].bind([](json::base *b){ | |
return b->to_number(); |
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
@protocol DBObjectVisitor | |
@required | |
- (void)visitDatabase:(DBDatabase *)database; | |
- (void)visitProcedure:(DBProcedure *)procedure; | |
... | |
@end | |
@interface DBObject | |
- (void)visitWith:(id<DBObjectVisitor>)visitor; | |
@end |