Skip to content

Instantly share code, notes, and snippets.

View jrwren's full-sized avatar
๐Ÿ’ญ
๐Ÿคฏ๐Ÿ’ฏ๐Ÿ‘๐Ÿ”ฅ๐ŸŽ‰๐Ÿคทโ€โ™€๏ธ๐Ÿ˜๐Ÿ˜•๐Ÿ•ด๐Ÿฝ๐Ÿ˜ต๐Ÿ˜ž๐Ÿค•๐Ÿคฎ

Jay R. Wren jrwren

๐Ÿ’ญ
๐Ÿคฏ๐Ÿ’ฏ๐Ÿ‘๐Ÿ”ฅ๐ŸŽ‰๐Ÿคทโ€โ™€๏ธ๐Ÿ˜๐Ÿ˜•๐Ÿ•ด๐Ÿฝ๐Ÿ˜ต๐Ÿ˜ž๐Ÿค•๐Ÿคฎ
View GitHub Profile
@jrwren
jrwren / gist:1665734
Created January 23, 2012 21:55
trace
#import <UIKit/UIKit.h>
@interface PopPushSegue : UIStoryboardSegue
@end
@implementation PopPushSegue
- (void)perform {
UIViewController *src = (UIViewController *) self.sourceViewController;
UIViewController *dst = (UIViewController *) self.destinationViewController;
@jrwren
jrwren / gist:1718828
Created February 1, 2012 19:38
nsarray map with block... yes, I don't know what I"m doing.. but I'll save this spike and someday I'll know
@interface NSArray (Map) {
}
//[fruitBasket mapWithBlock: ^(id x){ return [x peeledFruit]; }];
- (NSArray *)mapWithBlock: (id (^)(id obj))block;
@end
@implementation NSArray (Map)
- (NSArray *)mapWithBlock: (id (^)(id obj))block{
NSMutableArray *array = [[NSMutableArray alloc] init ];
for (id item in self) {
@jrwren
jrwren / gist:1895183
Created February 23, 2012 21:34
c++ on ios global initializer crash wtf?
I get this only when running on device, not simulator:
#0 0x0000ecd4 in aiVector3D::aiVector3D (this=0x3dbb9e, _x=0, _y=1, _z=0) at aiVector3D.h:64
#1 0x0000e8d8 in aiVector3D::aiVector3D (this=0x3dbb9e, _x=5.66926963e-39, _y=0, _z=1) at aiVector3D.h:64
#2 0x0019bb22 in __cxx_global_var_init1 ()
#3 0x0019bbc4 in global constructors keyed to a ()
#4 0x2fe0ced2 in __dyld__ZN16ImageLoaderMachO18doModInitFunctionsERKN11ImageLoader11LinkContextE ()
#5 0x2fe0cbd8 in __dyld__ZN16ImageLoaderMachO16doInitializationERKN11ImageLoader11LinkContextE ()
#6 0x2fe0a7d4 in __dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextEjRNS_21InitializerTimingListE ()
#7 0x2fe0b794 in __dyld__ZN11ImageLoader15runInitializersERKNS_11LinkContextERNS_21InitializerTimingListE ()
@jrwren
jrwren / gist:1925688
Created February 27, 2012 17:32
llvm gcc vs. Apple LLVM 3.0 (clang)
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (
#ifdef __clang__
strong,
#endif
nonatomic) UIWindow *window;
@end
Apr 6 11:02:47 delays kernel: [589187.872034] ata1.00: exception Emask 0x0 SAct 0x47 SErr 0x0 action 0x6 frozen
Apr 6 11:02:47 delays kernel: [589187.872040] ata1.00: failed command: WRITE FPDMA QUEUED
Apr 6 11:02:47 delays kernel: [589187.872047] ata1.00: cmd 61/10:00:8f:70:c3/00:00:12:00:00/40 tag 0 ncq 8192 out
Apr 6 11:02:47 delays kernel: [589187.872048] res 40/00:01:01:4f:c2/00:00:00:00:00/00 Emask 0x4 (timeout)
Apr 6 11:02:47 delays kernel: [589187.872051] ata1.00: status: { DRDY }
Apr 6 11:02:47 delays kernel: [589187.872054] ata1.00: failed command: WRITE FPDMA QUEUED
Apr 6 11:02:47 delays kernel: [589187.872059] ata1.00: cmd 61/08:08:37:54:56/00:00:38:00:00/40 tag 1 ncq 4096 out
Apr 6 11:02:47 delays kernel: [589187.872061] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
Apr 6 11:02:47 delays kernel: [589187.872064] ata1.00: status: { DRDY }
Apr 6 11:02:47 delays kernel: [589187.872066] ata1.00: failed command: WRITE FPDMA QUEUED
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค Modified configuration file โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ A new version of configuration file /etc/php5/cgi/php.ini is available, but the version installed currently has been locally modified. โ”‚
โ”‚ โ”‚
โ”‚ What do you want to do about modified configuration file php.ini? โ”‚
โ”‚ โ”‚
โ”‚
@jrwren
jrwren / gist:3020427
Created June 29, 2012 20:23
open ports nmap
Starting Nmap 5.21 ( http://nmap.org ) at 2012-06-29 16:11 EDT
Nmap scan report for XXX
Host is up (0.00062s latency).
XXX
Not shown: 983 closed ports
PORT STATE SERVICE
22/tcp open ssh
| ssh-hostkey: 1024 15:4f:e0:76:86:bf:4b:d2:b7:42:6f:ed:e6:48:90:42 (DSA)
|_2048 1c:46:3b:97:5e:75:8c:1a:44:f0:ca:ad:3d:56:21:bb (RSA)
@jrwren
jrwren / gist:3060622
Created July 6, 2012 14:52
seems slow for SSD, but what do I know?
Version 1.96 ------Sequential Output------ --Sequential Input- --Random-
Concurrency 1 -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP
rs-prank 36008M 901 99 131521 13 77201 9 3852 92 285002 17 2463 102Latency 12703us 342ms 785ms 52215us 145ms 641ms
Version 1.96 ------Sequential Create------ --------Random Create--------
rs-prank -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
files /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP
16 21541 24 +++++ +++ +++++ +++ +++++ +++ +++++ +++ +++++ +++
Latency 236us 488us 551us 254us 73us 2588us
1.96,1.96,rs-prank,1,1341575896,36008M,,901,99,131521,13,77201,9,3852,92,285002,17,2463,102,16,,,,,21541,24,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++,12703us,342ms,785ms,52215us,145ms,641ms,236us,488us,551us,254us,73us,
@jrwren
jrwren / gist:3719337
Created September 14, 2012 01:50
torrent announce urls
#!/usr/bin/env python
import sys
from deluge._libtorrent import lt
for a in sys.argv[1:]:
try:
info = lt.torrent_info(lt.bdecode(open(a).read()))
print("{0} {1}".format(info.name(), ', '.join((ae.url for ae in info.trackers()))))
except RuntimeError as e:
print("could not decode torrent file {0}".format(a))
@jrwren
jrwren / gist:3853137
Created October 8, 2012 15:32
my reply to OU about their hosting a political event.
I'm very disappointed that you promote a lying liar.
I would be much more proud of my alma mater if you instead put out a press release about how you decided NOT to hold this event because of the lies spoken.
This is not a partisan issue I would be equally proud if you denied this event if it were VP Joe Biden as the feature.
--
Jay R. Wren
On Oct 8, 2012, at 10:28 AM, "OU Alumni Update" <ouaa@oakland.edu> wrote: