A CQF elective with Dr. Yves J. Hilpisch, The Python Quants GmbH
General resources:
A CQF elective with Dr. Yves J. Hilpisch, The Python Quants GmbH
General resources:
Secure sessions are easy, but not very well documented. | |
Here's a recipe for secure sessions in Node.js when NginX is used as an SSL proxy: | |
The desired configuration for using NginX as an SSL proxy is to offload SSL processing | |
and to put a hardened web server in front of your Node.js application, like: | |
[NODE.JS APP] <- HTTP -> [NginX] <- HTTPS -> [PUBLIC INTERNET] <-> [CLIENT] | |
Edit for express 4.X and >: Express no longer uses Connect as its middleware framework, it implements its own now. |
@implementation UITextView (RSExtras) | |
static BOOL stringCharacterIsAllowedAsPartOfLink(NSString *s) { | |
/*[s length] is assumed to be 0 or 1. s may be nil. | |
Totally not a strict check.*/ | |
if (s == nil || [s length] < 1) | |
return NO; |
// Defines a yet undocumented method to add a warning if super isn't called. | |
#ifndef NS_REQUIRES_SUPER | |
#if __has_attribute(objc_requires_super) | |
#define NS_REQUIRES_SUPER __attribute((objc_requires_super)) | |
#else | |
#define NS_REQUIRES_SUPER | |
#endif | |
#endif | |
@interface UIViewController (SubclassingWarnings) |
#import <Foundation/Foundation.h> | |
@interface NSNumber (range) | |
- (NSIndexSet*):(NSUInteger)max; | |
- (NSIndexSet*):(NSUInteger)max step:(NSUInteger)step; | |
@end | |
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
##How Homakov hacked GitHub and the line of code that could have prevented it
Please note: THIS ARTICLE IS NOT WRITTEN BY THE GITHUB TEAM or in any way associated with them. It's simply hosted as a Gist because the markdown formatting is excellent and far clearer than anything I could manage on my personal Tumblr at peternixey.com.
If you'd like to follow me on twitter my handle is @peternixey
#! /bin/sh | |
# On alternate invocations, this script | |
# saves the path of the source file currently open in Xcode | |
# and restores the file at that path in Xcode. | |
# | |
# By setting Xcode (in Behaviors) to run this script when "Run Starts" | |
# and when "Run Completes", you can prevent it from switching to main.m | |
# when a run finishes. | |
# See http://stackoverflow.com/questions/7682277/xcode-4-2-jumps-to-main-m-every-time-after-stopping-simulator |
- (NSArray*)listOfNames { | |
NSFetchRequest *request = [[NSFetchRequest alloc] init]; | |
[request setEntity:[NSEntityDescription entityForName:@"SomeObject" inManagedObjectContext:self.managedObjectContext]]; | |
[request setResultType:NSDictionaryResultType]; | |
[request setPropertiesToFetch:[NSArray arrayWithObject:@"name"]]; | |
[request setPropertiesToGroupBy:[NSArray arrayWithObject:@"name"]]; | |
[request setPredicate:[NSPredicate predicateWithFormat:@"type = %@", @"static"]]; |
- (NSString *)uuidString { | |
// Returns a UUID | |
CFUUIDRef uuid = CFUUIDCreate(kCFAllocatorDefault); | |
NSString *uuidStr = (__bridge_transfer NSString *)CFUUIDCreateString(kCFAllocatorDefault, uuid); | |
CFRelease(uuid); | |
return uuidStr; | |
} |