Skip to content

Instantly share code, notes, and snippets.

View anvarazizov's full-sized avatar

Anvar Azizov anvarazizov

View GitHub Profile
@anvarazizov
anvarazizov / f3-api-example
Created May 19, 2015 07:59
Fat-free framework JSON API route example
$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);
}
);
@anvarazizov
anvarazizov / printTime.swift
Created October 13, 2017 01:03
print time in swift with milliseconds
func printDate(string: String) {
let date = Date()
let formatter = DateFormatter()
formatter.dateFormat = "HH:mm:ss.SSSS"
print(string + formatter.string(from: date))
}