Create a Meteor app and put the client_/server_ files in a client/server directories. Also, create a public dir to save the uploaded files.
This file contains hidden or 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 { | |
ActivityIndicator, | |
Button, | |
ScrollView, | |
Text, | |
View, | |
} from "react-native"; | |
import * as AuthSession from "expo-auth-session"; | |
import * as WebBrowser from "expo-web-browser"; | |
import { useEffect, useState } from "react"; |
This file contains hidden or 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 EmailedZipFileExtractor | |
# This class downloads an email from gmail and extracts a file out of a .zip attachment | |
require 'google/apis/gmail_v1' | |
require 'googleauth' | |
require 'zip' | |
# These credentials come from creating an OAuth Web Application client ID | |
# in the Google developer console | |
# |
This file contains hidden or 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
#pragma mark DLCImagePickerControllerDelegate | |
-(void) imagePickerControllerDidCancel:(DLCImagePickerController *)picker{ | |
[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:NO]; | |
[self dismissModalViewControllerAnimated:YES]; | |
} | |
- (void)uploadMediaInfo:(NSDictionary *)info { | |
UIImage *resizedImage = [[info objectForKey:@"image"] imageCroppedToFitSize:CGSizeMake(800, 800)]; | |
NSData *jpegData = UIImageJPEGRepresentation(resizedImage, 0.5); |
This file contains hidden or 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
# put this in your ~/.irbrc | |
begin | |
require 'pry' | |
Pry.start | |
exit | |
rescue LoadError | |
puts "Pry not found, using 'irb' instead. Try\n gem install pry" | |
end |
Note: the original location of this article is on my blog, however, it is posted here too for better readability.
In this article, we will see how to use Core Data for accessing your API. We will use the Bandcamp API as our running example. I've only been experimenting with this code for a few days, so there might be mistakes in there.
Note: the original location of this article is on my blog, however, it is posted here too for better readability.
In this article, we will see how to use Core Data for accessing your API. We will use the Bandcamp API as our running example. I've only been experimenting with this code for a few days, so there might be mistakes in there.
This file contains hidden or 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
def handle_gzip_params | |
# When the server receives a request with content-type "gzip/json" this will be called which will unzip it, | |
# and then parse it as json | |
# The use case is so clients such as Android or Iphone can zip their long request such as Inviters#addressbook emails | |
# Then the server can unpack the request and parse the parameters as normal. | |
if request.content_type == "gzip/json" | |
data = ActiveSupport::JSON.decode(ActiveSupport::Gzip.decompress(request.raw_post)) | |
data = {:_json => data} unless data.is_a?(Hash) | |
params ||= {} |
This file contains hidden or 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
// | |
// NSObject+setValuesForKeysWithJSONDictionary.h | |
// SafeSetDemo | |
// | |
// Created by Tom Harrington on 12/29/11. | |
// Copyright (c) 2011 Atomic Bird, LLC. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
NewerOlder