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
// next.config.js | |
const nextConfig = { | |
async rewrites() { | |
return [ | |
// Sentry | |
{ | |
source: '/sentry(/?)', | |
has: [ | |
{ | |
type: 'query', |
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 timeit | |
print 'set/array of numbers' | |
print '' | |
print 'first in set:', timeit.timeit('1 in set([1, 2, 3, 4, 5, 6, 7, 8, 9])', number=10000000) | |
print 'last in set: ', timeit.timeit('9 in set([1, 2, 3, 4, 5, 6, 7, 8, 9])', number=10000000) | |
print 'not in set: ', timeit.timeit('0 in set([1, 2, 3, 4, 5, 6, 7, 8, 9])', number=10000000) | |
print '' |
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
<?php | |
$teamURL = ""; | |
$username = ""; | |
$password = ""; | |
if(empty($teamURL)){ | |
echo "You can hard code your team's main site URL, along with all user inputs at the top of the source file.\n"; | |
echo "To find your team's site, login to t-square, navigate to your team's site, and copy the current url.\n"; | |
echo "It should look something like this: https://t-square.gatech.edu/portal/site/abcd1234-ab12-cd34-ad14-abcd1234a1b2\n"; |
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
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string | |
{ | |
// new number | |
NSString *phoneNumber = [textField.text stringByReplacingCharactersInRange:range withString:string]; | |
// strip non-numbers | |
NSString *rawPhoneNumber = [[phoneNumber componentsSeparatedByCharactersInSet:[[NSCharacterSet decimalDigitCharacterSet] invertedSet]] componentsJoinedByString:@""]; | |
if(string.length == 0 && rawPhoneNumber.length == 3){ | |
// delete again | |
phoneNumber = [phoneNumber stringByReplacingCharactersInRange:NSMakeRange(range.location-2, range.length) withString:string]; |