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
/* | |
The following data should be run in the console while viewing the page https://read.amazon.com/ | |
It will export a CSV file called "download" which can (and should) be renamed with a .csv extension | |
modified version of the original script: https://gist.github.com/jkubecki/d61d3e953ed5c8379075b5ddd8a95f22 | |
changes: | |
* adds a column indicating samples (EBSP) | |
* updates the database version | |
* escapes double quotes instead of stripping them | |
*/ |
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 UIKit | |
import PlaygroundSupport | |
class MyViewController: UIViewController { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
// Main view | |
view.backgroundColor = .black |
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
func printDate(string: String) { | |
let date = Date() | |
let formatter = DateFormatter() | |
formatter.dateFormat = "HH:mm:ss.SSSS" | |
print(string + formatter.string(from: date)) | |
} |
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)shareImageToInstagram:(UIImage *)image inView:(UIView *)view | |
{ | |
NSURL * instagramURL = [NSURL URLWithString:@"instagram://"]; | |
if ([[UIApplication sharedApplication] canOpenURL:instagramURL]) | |
{ | |
NSString * documentDirectory = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]; | |
NSString * saveImagePath = [documentDirectory stringByAppendingPathComponent:@"Image.igo"]; | |
NSData * imageData = UIImagePNGRepresentation(image); | |
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
Parse.Cloud.beforeSave("Photo", function(request, response) { | |
console.log("version is:" + request.object.get("version")); | |
var version = request.object.get("version"); | |
if (version == null && version == undefined ) { | |
version = 0; | |
} | |
version += 1; | |
console.log("version is:" + 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
Parse.Cloud.job("sendPush", function(request, status) { | |
Parse.Push.send({ | |
channels: ["global"], | |
data: | |
{ | |
"alert": "Update process has started", | |
"content-available":"1", | |
} | |
}, | |
{ |
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
NSLog (@"Font families: %@", [UIFont familyNames]); |
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
$f3->route('GET /api/user/@id', | |
function($f3) { | |
$id = $f3->get('PARAMS.id'); | |
header('Content-Type: application/json'); | |
$data = array('id'=>$id, 'name'=>'Taras', 'lastname'=>'Shevchenko'); | |
echo json_encode($data); | |
} | |
); |
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 | |
$uploaddir = './uploads/'; | |
$file = basename($_FILES['userfile']['name']); | |
$uploadfile = $uploaddir . $file; | |
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) { | |
echo "http://iphone.zcentric.com/uploads/{$file}"; | |
} | |
?> |
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)sortArray:(NSMutableArray *)array withLeft:(NSInteger )left andRight:(NSInteger )right | |
{ | |
NSInteger i = left - 1; | |
NSInteger j = right; | |
NSInteger p = left - 1; | |
NSInteger q = right; | |
if (right <= left) | |
return; | |
NewerOlder