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
# Ruleset to block all incoming traffic on WiFi | |
block in on en0 | |
pass out on en0 keep state | |
# Rules to allow DHCP (you won't get an address without these) | |
pass in on en0 proto udp from any port 68 | |
pass in on en0 proto udp from any port 67 | |
# Rules for Bonjour (uncomment these to allow Bonjour to work) | |
# Bonjour is needed for AirPlay, Home Sharing, Printer Discovery, etc. | |
# You can constrict this to your home network by changing any to your home network (E.x. 192.168.1.0/24) |
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
phase 1: 3des-sha1-modp1024 | |
phase 2: aes256-sha1-modp1024 |
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
--- | |
Name: ModelType Test | |
Heads: | |
Java: | | |
// This is the head for the java file | |
package com.modeltype.Test; | |
MongooseTS: | | |
// This is the head for the mongoose file | |
import * as crypto from "crypto"; |
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
var securePin = require("secure-pin"); | |
securePin.generatePin(4, function(pin) { | |
console.log(pin); | |
}); |
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
declare module "node-forge" { | |
export namespace pki { | |
export class Key { | |
e: any; | |
n: any; | |
} | |
export class PrivateKey extends Key { | |
d: any; | |
} |
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
// Omar Zouai | https://omarzouai.com/ | |
- (NSMutableAttributedString*)htmlToAttributed:(NSString*)html font:(UIFont*)font paragraphSpacing:(CGFloat)pSpacing { | |
NSMutableAttributedString *string = [[NSMutableAttributedString alloc] initWithData:[html dataUsingEncoding:NSUTF8StringEncoding] options:@{NSDocumentTypeDocumentAttribute:NSHTMLTextDocumentType, NSCharacterEncodingDocumentAttribute:@(NSUTF8StringEncoding)} documentAttributes:nil error:nil]; | |
[string beginEditing]; | |
NSMutableParagraphStyle *pStyle = [[NSMutableParagraphStyle defaultParagraphStyle] mutableCopy]; | |
[pStyle setParagraphSpacing:pSpacing]; | |
[string enumerateAttributesInRange:NSMakeRange(0, string.length) options:nil usingBlock:^(NSDictionary *attrs, NSRange range, BOOL *stop) { | |
UIFont *theFont = [attrs objectForKey:@"NSFont"]; |
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
// Omar Zouai | https://omarzouai.com/ | |
-(NSString*) suffixForDate:(NSDate*) date { | |
NSDateFormatter *monthDayFormatter = [[NSDateFormatter alloc] init]; | |
[monthDayFormatter setFormatterBehavior:NSDateFormatterBehavior10_4]; | |
[monthDayFormatter setDateFormat:@"d"]; | |
int date_day = [[monthDayFormatter stringFromDate:date] intValue]; | |
NSString *suffix = @"th"; | |
if(date_day <=10 || date_day >=20) { | |
int singleDay = (date_day%10); | |
if(singleDay == 1) suffix = @"st"; |