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
- (void)askListName { | |
UIAlertView *alertView = [[UIAlertView alloc]initWithTitle:@"List Name" | |
message:@"Desired Name for your new List?" | |
delegate:self | |
cancelButtonTitle:@"Cancel" | |
otherButtonTitles:@"Create", nil]; | |
[alertView setAlertViewStyle:UIAlertViewStylePlainTextInput]; | |
[alertView.rac_buttonClickedSignal subscribeNext:^(NSNumber *buttonIndex) { | |
if ([buttonIndex isEqual:@1]) { | |
[[MWGListsManager sharedInstance] addListWithName:[[alertView textFieldAtIndex:0] text]]; |
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
- (void)emitParticle:(SKScene *)whichScene { | |
NSString *emitterPath = [[NSBundle mainBundle] pathForResource:@"YourParticleFileName" ofType:@"sks"]; | |
SKEmitterNode *particle = [NSKeyedUnarchiver unarchiveObjectWithFile:emitterPath]; | |
particle.position = self.position; | |
particle.name = @"particleName"; | |
particle.targetNode = self.scene; | |
[yourScene addChild:particle]; | |
} |
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 Vehicle { | |
var currentSpeed = 0.0 | |
var description: String { | |
return "traveling at \(currentSpeed) miles per hour" | |
} | |
func makeNoise() { | |
// do nothing - an arbitrary vehicle doesn't necessarily make a noise | |
} | |
} |
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
- (instancetype)initWithTitle:(NSString *)title iconBadgeNumber:(int)number iconBadgeColor:(UIColor *)backgroundColor iconBadgeTextColor:(UIColor *)textColor action:(actionBasicBlock)action | |
{ | |
self = [[[NSBundle mainBundle] loadNibNamed:@"QBasicTableViewCell" owner:self options:nil] objectAtIndex:0]; | |
if (self) { | |
//le code | |
} | |
return self; | |
} |
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
let json = try JSON(data: response) | |
let movies: [Movie]? | |
switch json { | |
case let .array(jsonModels): | |
let moviesDict = try jsonModels.map { try JSON($0.getDictionary(at: "movie")) } | |
movies = try moviesDict.map(Movie.init) | |
default: | |
movies = nil | |
} |
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
Makefile.binfile:18: recipe for target 'STM32F769I_Chris_out/DEBUG/application_int.bin' failed | |
make[1]: o:/CRCTool/emb_crc.exe: Command not found | |
make[1]: *** [STM32F769I_Chris_out/DEBUG/application_int.bin] Error 127 | |
make[1]: *** Waiting for unfinished jobs.... | |
(CRCTOOL) STM32F769I_Chris_out/DEBUG/application_ext.bin | |
make[1]: o:/CRCTool/emb_crc.exe: Command not found | |
Makefile.binfile:28: recipe for target 'STM32F769I_Chris_out/DEBUG/application_ext.bin' failed | |
make[1]: *** [STM32F769I_Chris_out/DEBUG/application_ext.bin] Error 127 | |
make: *** [bin] Error 2 | |
Makefile:58: recipe for target 'bin' failed |
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
float noise(vec2 st) { | |
vec2 i = floor(st); | |
vec2 f = fract(st); | |
vec2 u = f * f * (3.0 - 2.0 * f); | |
return mix( mix( dot( random2(i + vec2(0.0, 0.0) ), f - vec2(0.0, 0.0) ), | |
dot( random2(i + vec2(1.0, 0.0) ), f - vec2(1.0, 0.0) ), u.x), | |
mix( dot( random2(i + vec2(0.0, 1.0) ), f - vec2(0.0, 1.0) ), | |
dot( random2(i + vec2(1.0, 1.0) ), f - vec2(1.0, 1.0) ), u.x), u.y); |
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
// Permutation polynomial: (34x^2 + x) mod 289 | |
vec4 permute(vec4 x) { | |
return mod((34.0 * x + 1.0) * x, 289.0); | |
} | |
// Cellular noise, returning F1 and F2 in a vec2. | |
// Speeded up by using 2x2 search window instead of 3x3, | |
// at the expense of some strong pattern artifacts. | |
// F2 is often wrong and has sharp discontinuities. | |
// If you need a smooth F2, use the slower 3x3 version. |
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
float circle(vec2 p, float radius) { | |
return length(p) - radius; | |
} | |
float rect(vec2 p, vec2 size) { | |
vec2 d = abs(p) - size; | |
return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)); | |
} | |
float roundRect(vec2 p, vec2 size, float radius) { |
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
/* | |
%1$@ = city | |
%2$@ = temperature | |
%3$@ = perceived | |
%4$@ = probability | |
%5$@ = amount | |
%6$@ = speed | |
%7$@ = duration | |
*/ | |
"now.cast %@ %@ %@ %@ %@ %@ %@" = "Current temperature in %1$@: %2$@ which feels like %3$@ with %4$@ of rain probability and %5$@ of amount. Wind speeds up to %6$@ and %7$@ of sun duration."; |
OlderNewer