Skip to content

Instantly share code, notes, and snippets.

View anthonycvella's full-sized avatar

Anthony Vella anthonycvella

View GitHub Profile
// NOTE: First make sure you have jquery included by placing this at the bottom of your .html file, before the </body> and </html> tags
<script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
// The full url path with a difficulty of "easy"
url = "https://it3049c-hangman.now.sh?difficulty=easy";
// Performs the ajax request using the GET method with a parameter in the provided url. An object is returned after using the "word"
// key to get its value
// @param url The url of the address
function getWord(url) {
@anthonycvella
anthonycvella / API Module
Created June 22, 2017 17:57
JSON Optimization for Parsing Vainglory Telemetry Data
' Parses a JSON response and returns an Object
Public Function ParseJSON(data As String) As Object
' First split the string at the "PlayerFirstSpawn" action
Dim splitArray() As String
splitArray() = Split(data, "PlayerFirstSpawn")
' Get the position of the { character which would have been on the line of "PlayerFirstSpawn"
Dim splitTail As String
splitTail = InStrRev(splitArray(0), "{ ")
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author Anthony
*/
public class BankAccountDriver {
2013-08-03 21:49:25.636 Runway Management System[3482:c07] response: [Array
(
[file] => Array
(
[name] => nMjas8cmdRz8USe1js1Y.jpeg
[type] => image/jpeg
[tmp_name] => /Applications/XAMPP/xamppfiles/temp/phpQ2bf8A
[error] => 0
[size] => 20471
)
2013-08-03 20:55:09.985 Runway Management System[3084:c07] response: [Array
(
[oatmeal] => Array
(
[name] => oatmeal.jpeg
[type] => image/jpeg
[tmp_name] => /Applications/XAMPP/xamppfiles/temp/phpxwvK4W
[error] => 0
[size] => 17264
)
2013-08-03 20:30:49.932 Runway Management System[2938:c07] response: [<br />
<b>Fatal error</b>: Call to undefined function sendResponse() in <b>/Applications/XAMPP/xamppfiles/htdocs/RMS/api.php</b> on line <b>70</b><br />
]
function upload()
{
$signID = isset( $_POST['signID'] ) ? $_POST['signID'] : false ;
$uploaddir = '/uploads/';
$file = basename($_FILES['file']['name']);
$uploadfile = $uploaddir . $file;
if (move_uploaded_file($_FILES['file']['tmp_name'], $uploadfile)) {
sendResponse(200, 'Upload Successful');
2013-08-03 21:01:58.016 Runway Management System[3113:c07] response: [Array
(
[oatmeal] => Array
(
[name] => oatmeal.jpeg
[type] => image/jpeg
[tmp_name] => /Applications/XAMPP/xamppfiles/temp/phpAUzBVC
[error] => 0
[size] => 17264
)
- (IBAction)btnConvert:(id)sender {
NSString *urlString = urlField.text;
answerData = [NSData dataWithContentsOfURL:[NSURL URLWithString:urlString]];
html = [[NSString alloc] initWithData:answerData encoding:NSUTF8StringEncoding];
NSLog(@"Source: %@", html);
NSRegularExpression *regexp = [NSRegularExpression regularExpressionWithPattern:@"((?<=ansMap\\[\\d] = ')|(?<=ansMap\\[\\d\\d] = '))\\w+" options:NSRegularExpressionAnchorsMatchLines error:NULL];
NSArray *numberOfMatches = [regexp matchesInString:html options:0 range:NSMakeRange(0, [html length])];
// Calls the loadGames method in CheckInViewController
UITabBarController *tabBarController = (UITabBarController *)self.presentingViewController;
UINavigationController *navController = [tabBarController.viewControllers objectAtIndex:0];
CheckInViewController *checkInViewController = [navController.viewControllers objectAtIndex:0];
SettingsTableViewController *settingsTableViewController = [navController.viewControllers objectAtIndex:0];
[checkInViewController loadGames];
[settingsTableViewController loadSettings];